protected $original_nav_menu_locations;
/**
* Constructor.
*
* @since 4.3.0
*
* @param WP_Customize_Manager $manager Customizer bootstrap instance.
*/
public function __construct( $manager ) { $this->manager =
$manager;
$this->original_nav_menu_locations =
get_nav_menu_locations();
// See https://github.com/xwp/wp-customize-snapshots/blob/962586659688a5b1fd9ae93618b7ce2d4e7a421c/php/class-customize-snapshot-manager.php#L469-L499
add_action( 'customize_register', array
( $this, 'customize_register'
), 11
);
add_filter( 'customize_dynamic_setting_args', array
( $this, 'filter_dynamic_setting_args'
), 10, 2
);
add_filter( 'customize_dynamic_setting_class', array
( $this, 'filter_dynamic_setting_class'
), 10, 3
);
add_action( 'customize_save_nav_menus_created_posts', array
( $this, 'save_nav_menus_created_posts'
) );
// Skip remaining hooks when the user can't manage nav menus anyway.
if ( !
current_user_can( 'edit_theme_options'
) ) { return;
}