]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-includes/customize/class-wp-customize-nav-menu-section.php
WordPress 4.5
[autoinstalls/wordpress.git] / wp-includes / customize / class-wp-customize-nav-menu-section.php
1 <?php
2 /**
3  * Customize API: WP_Customize_Nav_Menu_Section class
4  *
5  * @package WordPress
6  * @subpackage Customize
7  * @since 4.4.0
8  */
9
10 /**
11  * Customize Menu Section Class
12  *
13  * Custom section only needed in JS.
14  *
15  * @since 4.3.0
16  *
17  * @see WP_Customize_Section
18  */
19 class WP_Customize_Nav_Menu_Section extends WP_Customize_Section {
20
21         /**
22          * Control type.
23          *
24          * @since 4.3.0
25          * @access public
26          * @var string
27          */
28         public $type = 'nav_menu';
29
30         /**
31          * Get section parameters for JS.
32          *
33          * @since 4.3.0
34          * @access public
35          * @return array Exported parameters.
36          */
37         public function json() {
38                 $exported = parent::json();
39                 $exported['menu_id'] = intval( preg_replace( '/^nav_menu\[(\d+)\]/', '$1', $this->id ) );
40
41                 return $exported;
42         }
43 }