Closed sc0ttkclark closed 9 years ago
is_customize_preview() in wp-includes/theme.php will always return false because the class is no longer an instanceof WP_Customize_Manager
:
/**
* Whether the site is being previewed in the Customizer.
*
* @since 4.0.0
*
* @global WP_Customize_Manager $wp_customize Customizer instance.
*
* @return bool True if the site is being previewed in the Customizer, false otherwise.
*/
function is_customize_preview() {
global $wp_customize;
return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
}
Core will need a way for us to override this.
Actually the above should be fine, our implementation uses WP_Customize_Manager
and assumes the core class never gets loaded.
Implemented in latest commits
Add hooks to auto-override customizer classes and user-edit.php for testing purposes.
Customizer manager class override:
User profile edit override: