wordpress/wp-content/themes/basic/themify/customizer/class-themify-customizer.php
/**
		 * Disables some options in Customizer screen in order to lighten the load
		 *
		 * Currently both Widgets and Menus admin screens are disabled if Themify > Customize menu is used.
		 */
Disables some options in Customizer screen in order to lighten the load
Currently both Widgets and Menus admin screens are disabled if Themify > Customize menu is used.
Disables some options in Customizer screen in order to lighten the load Currently both Widgets and Menus admin screens are disabled if Themify > Customize menu is used .
function disable_menus_and_widgets() {
			global $wp_customize;
			if ( isset( $wp_customize ) && isset( $_GET['themify'] ) && $_GET['themify'] === '1' ) {
				remove_filter( 'customize_dynamic_setting_args',          array( $wp_customize->widgets, 'filter_customize_dynamic_setting_args' ), 10, 2 );
				remove_action( 'widgets_init',                            array( $wp_customize->widgets, 'register_settings' ), 95 );
				remove_action( 'customize_register',                      array( $wp_customize->widgets, 'schedule_customize_register' ), 1 );
				remove_action( 'wp_loaded',                               array( $wp_customize->widgets, 'override_sidebars_widgets_for_theme_switch' ) );
				remove_action( 'customize_controls_init',                 array( $wp_customize->widgets, 'customize_controls_init' ) );
				remove_action( 'customize_controls_enqueue_scripts',      array( $wp_customize->widgets, 'enqueue_scripts' ) );
				remove_action( 'customize_controls_print_styles',         array( $wp_customize->widgets, 'print_styles' ) );
				remove_action( 'customize_controls_print_scripts',        array( $wp_customize->widgets, 'print_scripts' ) );
				remove_action( 'customize_controls_print_footer_scripts', array( $wp_customize->widgets, 'print_footer_scripts' ) );
				remove_action( 'customize_controls_print_footer_scripts', array( $wp_customize->widgets, 'output_widget_control_templates' ) );
				remove_action( 'customize_preview_init',                  array( $wp_customize->widgets, 'customize_preview_init' ) );
				remove_filter( 'customize_refresh_nonces',                array( $wp_customize->widgets, 'refresh_nonces' ) );
				remove_action( 'dynamic_sidebar',                         array( $wp_customize->widgets, 'tally_rendered_widgets' ) );
				remove_filter( 'is_active_sidebar',                       array( $wp_customize->widgets, 'tally_sidebars_via_is_active_sidebar_calls' ), 10, 2 );
				remove_filter( 'dynamic_sidebar_has_widgets',             array( $wp_customize->widgets, 'tally_sidebars_via_dynamic_sidebar_calls' ), 10, 2 );
				remove_filter( 'customize_dynamic_partial_args',          array( $wp_customize->widgets, 'customize_dynamic_partial_args' ), 10, 2 );
				remove_action( 'customize_preview_init',                  array( $wp_customize->widgets, 'selective_refresh_init' ) );
				remove_action( 'customize_register', array( $wp_customize->nav_menus, 'customize_register' ), 11 );
				remove_filter( 'customize_dynamic_setting_args', array( $wp_customize->nav_menus, 'filter_dynamic_setting_args' ), 10, 2 );
				remove_filter( 'customize_dynamic_setting_class', array( $wp_customize->nav_menus, 'filter_dynamic_setting_class' ), 10, 3 );
				remove_action( 'customize_save_nav_menus_created_posts', array( $wp_customize->nav_menus, 'save_nav_menus_created_posts' ) );
				remove_filter( 'customize_refresh_nonces', array( $wp_customize->nav_menus, 'filter_nonces' ) );
				remove_action( 'wp_ajax_load-available-menu-items-customizer', array( $wp_customize->nav_menus, 'ajax_load_available_items' ) );
				remove_action( 'wp_ajax_search-available-menu-items-customizer', array( $wp_customize->nav_menus, 'ajax_search_available_items' ) );
				remove_action( 'wp_ajax_customize-nav-menus-insert-auto-draft', array( $wp_customize->nav_menus, 'ajax_insert_auto_draft_post' ) );
				remove_action( 'customize_controls_enqueue_scripts', array( $wp_customize->nav_menus, 'enqueue_scripts' ) );
				remove_action( 'customize_controls_print_footer_scripts', array( $wp_customize->nav_menus, 'print_templates' ) );
				remove_action( 'customize_controls_print_footer_scripts', array( $wp_customize->nav_menus, 'available_items_template' ) );
				remove_action( 'customize_preview_init', array( $wp_customize->nav_menus, 'customize_preview_init' ) );
				remove_action( 'customize_preview_init', array( $wp_customize->nav_menus, 'make_auto_draft_status_previewable' ) );
				remove_filter( 'customize_dynamic_partial_args', array( $wp_customize->nav_menus, 'customize_dynamic_partial_args' ), 10, 2 );
			}
		}
function disable_menus_and_widgets ( ) { global $ wp_customize ; if ( isset ( $ wp_customize ) && isset ( $ _GET [ 'themify' ] ) && $ _GET [ 'themify' ] === '1' ) { remove_filter ( 'customize_dynamic_setting_args' , array ( $ wp_customize -> widgets , 'filter_customize_dynamic_setting_args' ) , 10 , 2 ) ; remove_action ( 'widgets_init' , array ( $ wp_customize -> widgets , 'register_settings' ) , 95 ) ; remove_action ( 'customize_register' , array ( $ wp_customize -> widgets , 'schedule_customize_register' ) , 1 ) ; remove_action ( 'wp_loaded' , array ( $ wp_customize -> widgets , 'override_sidebars_widgets_for_theme_switch' ) ) ; remove_action ( 'customize_controls_init' , array ( $ wp_customize -> widgets , 'customize_controls_init' ) ) ; remove_action ( 'customize_controls_enqueue_scripts' , array ( $ wp_customize -> widgets , 'enqueue_scripts' ) ) ; remove_action ( 'customize_controls_print_styles' , array ( $ wp_customize -> widgets , 'print_styles' ) ) ; remove_action ( 'customize_controls_print_scripts' , array ( $ wp_customize -> widgets , 'print_scripts' ) ) ; remove_action ( 'customize_controls_print_footer_scripts' , array ( $ wp_customize -> widgets , 'print_footer_scripts' ) ) ; remove_action ( 'customize_controls_print_footer_scripts' , array ( $ wp_customize -> widgets , 'output_widget_control_templates' ) ) ; remove_action ( 'customize_preview_init' , array ( $ wp_customize -> widgets , 'customize_preview_init' ) ) ; remove_filter ( 'customize_refresh_nonces' , array ( $ wp_customize -> widgets , 'refresh_nonces' ) ) ; remove_action ( 'dynamic_sidebar' , array ( $ wp_customize -> widgets , 'tally_rendered_widgets' ) ) ; remove_filter ( 'is_active_sidebar' , array ( $ wp_customize -> widgets , 'tally_sidebars_via_is_active_sidebar_calls' ) , 10 , 2 ) ; remove_filter ( 'dynamic_sidebar_has_widgets' , array ( $ wp_customize -> widgets , 'tally_sidebars_via_dynamic_sidebar_calls' ) , 10 , 2 ) ; remove_filter ( 'customize_dynamic_partial_args' , array ( $ wp_customize -> widgets , 'customize_dynamic_partial_args' ) , 10 , 2 ) ; remove_action ( 'customize_preview_init' , array ( $ wp_customize -> widgets , 'selective_refresh_init' ) ) ; remove_action ( 'customize_register' , array ( $ wp_customize -> nav_menus , 'customize_register' ) , 11 ) ; remove_filter ( 'customize_dynamic_setting_args' , array ( $ wp_customize -> nav_menus , 'filter_dynamic_setting_args' ) , 10 , 2 ) ; remove_filter ( 'customize_dynamic_setting_class' , array ( $ wp_customize -> nav_menus , 'filter_dynamic_setting_class' ) , 10 , 3 ) ; remove_action ( 'customize_save_nav_menus_created_posts' , array ( $ wp_customize -> nav_menus , 'save_nav_menus_created_posts' ) ) ; remove_filter ( 'customize_refresh_nonces' , array ( $ wp_customize -> nav_menus , 'filter_nonces' ) ) ; remove_action ( 'wp_ajax_load-available-menu-items-customizer' , array ( $ wp_customize -> nav_menus , 'ajax_load_available_items' ) ) ; remove_action ( 'wp_ajax_search-available-menu-items-customizer' , array ( $ wp_customize -> nav_menus , 'ajax_search_available_items' ) ) ; remove_action ( 'wp_ajax_customize-nav-menus-insert-auto-draft' , array ( $ wp_customize -> nav_menus , 'ajax_insert_auto_draft_post' ) ) ; remove_action ( 'customize_controls_enqueue_scripts' , array ( $ wp_customize -> nav_menus , 'enqueue_scripts' ) ) ; remove_action ( 'customize_controls_print_footer_scripts' , array ( $ wp_customize -> nav_menus , 'print_templates' ) ) ; remove_action ( 'customize_controls_print_footer_scripts' , array ( $ wp_customize -> nav_menus , 'available_items_template' ) ) ; remove_action ( 'customize_preview_init' , array ( $ wp_customize -> nav_menus , 'customize_preview_init' ) ) ; remove_action ( 'customize_preview_init' , array ( $ wp_customize -> nav_menus , 'make_auto_draft_status_previewable' ) ) ; remove_filter ( 'customize_dynamic_partial_args' , array ( $ wp_customize -> nav_menus , 'customize_dynamic_partial_args' ) , 10 , 2 ) ; } }
Disables some options in Customizer screen in order to lighten the load
 Currently both Widgets and Menus admin screens are disabled if Themify > Customize menu is used.
Disables some options in Customizer screen in order to lighten the load Currently both Widgets and Menus admin screens are disabled if Themify > Customize menu is used .
/**
				 * Disable widgets manager in Customizer
				 * original hooks located in wp-includes/class-wp-customize-widgets.php
				 */ /**
				 * Disable Menus manager in Customizer
				 * original hooks located in wp-includes/class-wp-customize-nav-menus.php
				 */