summaryrefslogtreecommitdiffstats
path: root/wp-includes/customize/class-wp-customize-nav-menu-section.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:56:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:56:49 +0000
commita415c29efee45520ae252d2aa28f1083a521cd7b (patch)
treef4ade4b6668ecc0765de7e1424f7c1427ad433ff /wp-includes/customize/class-wp-customize-nav-menu-section.php
parentInitial commit. (diff)
downloadwordpress-a415c29efee45520ae252d2aa28f1083a521cd7b.tar.xz
wordpress-a415c29efee45520ae252d2aa28f1083a521cd7b.zip
Adding upstream version 6.4.3+dfsg1.upstream/6.4.3+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/customize/class-wp-customize-nav-menu-section.php')
-rw-r--r--wp-includes/customize/class-wp-customize-nav-menu-section.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/wp-includes/customize/class-wp-customize-nav-menu-section.php b/wp-includes/customize/class-wp-customize-nav-menu-section.php
new file mode 100644
index 0000000..225d035
--- /dev/null
+++ b/wp-includes/customize/class-wp-customize-nav-menu-section.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Customize API: WP_Customize_Nav_Menu_Section class
+ *
+ * @package WordPress
+ * @subpackage Customize
+ * @since 4.4.0
+ */
+
+/**
+ * Customize Menu Section Class
+ *
+ * Custom section only needed in JS.
+ *
+ * @since 4.3.0
+ *
+ * @see WP_Customize_Section
+ */
+class WP_Customize_Nav_Menu_Section extends WP_Customize_Section {
+
+ /**
+ * Control type.
+ *
+ * @since 4.3.0
+ * @var string
+ */
+ public $type = 'nav_menu';
+
+ /**
+ * Get section parameters for JS.
+ *
+ * @since 4.3.0
+ * @return array Exported parameters.
+ */
+ public function json() {
+ $exported = parent::json();
+ $exported['menu_id'] = (int) preg_replace( '/^nav_menu\[(-?\d+)\]/', '$1', $this->id );
+
+ return $exported;
+ }
+}