3 * Customize API: WP_Customize_Nav_Menu_Location_Control class
6 * @subpackage Customize
11 * Customize Menu Location Control Class.
13 * This custom control is only needed for JS.
17 * @see WP_Customize_Control
19 class WP_Customize_Nav_Menu_Location_Control extends WP_Customize_Control {
28 public $type = 'nav_menu_location';
37 public $location_id = '';
40 * Refresh the parameters passed to JavaScript via JSON.
45 * @see WP_Customize_Control::to_json()
47 public function to_json() {
49 $this->json['locationId'] = $this->location_id;
53 * Render content just like a normal select control.
58 public function render_content() {
59 if ( empty( $this->choices ) ) {
64 <?php if ( ! empty( $this->label ) ) : ?>
65 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
68 <?php if ( ! empty( $this->description ) ) : ?>
69 <span class="description customize-control-description"><?php echo $this->description; ?></span>
72 <select <?php $this->link(); ?>>
74 foreach ( $this->choices as $value => $label ) :
75 echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>';