Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Jonnyauk/Wonderflux
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonnyauk committed Nov 1, 2017
2 parents 827c02b + 00a7960 commit d9bed1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions functions.php
Expand Up @@ -146,7 +146,7 @@
add_action( 'wffooter_after_content', 'wfx_display_credit', 1 );
add_action( 'wf_footer', 'wfx_display_code_credit', 3 );
add_action( 'auth_redirect', 'wfx_admin_menus' );
add_filter( 'theme_page_templates','wfx_remove_page_templates' );
add_filter( 'theme_page_templates', 'wfx_remove_page_templates' );


//// 1.6 // Wonderflux debug functionality
Expand Down Expand Up @@ -1712,13 +1712,18 @@
/**
* Remove unwanted page templates from page attributes dropdown as set in Wonderflux options.
* Filters theme_page_templates.
* NOTE: Added check for admin to stop this breaking WP REST API
*
* @since 2.0
* @version 2.0
* @version 2.6
*
* @param [array] $input Pass through WordPress page template array for manipulation via filter.
*/
if ( !function_exists( 'wfx_remove_page_templates' ) ) : function wfx_remove_page_templates($input) { global $wfx_admin_post; return $wfx_admin_post->remove_page_templates($input); } endif;
if ( !function_exists( 'wfx_remove_page_templates' ) ) : function wfx_remove_page_templates($input) {
if ( is_admin() ) {
global $wfx_admin_post; return $wfx_admin_post->remove_page_templates($input);
}
} endif;


/*
Expand Down
3 changes: 2 additions & 1 deletion wf-includes/wf-admin-functions.php
Expand Up @@ -1327,9 +1327,10 @@ class wflux_admin_post extends wflux_data {
/**
* Remove unwanted page templates from page attributes dropdown as set in Wonderflux options.
* Filters theme_page_templates.
* NOTE: Added check for admin in functions.php to stop this breaking WP REST API
*
* @since 2.0
* @version 2.0
* @version 2.6
*
* @param [array] $input Pass through WordPress page template array for manipulation via filter.
*/
Expand Down

0 comments on commit d9bed1d

Please sign in to comment.