$66 GRAYBYTE WORDPRESS FILE MANAGER $11

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.217.21
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravetechrwanda/dantho.rw/wp-includes/

HOME
Current File : /home/bravetechrwanda/dantho.rw/wp-includes//class-wp-customize-nav-menus.php
<?php
/**
 * WordPress Customize Nav Menus classes
 *
 * @package WordPress
 * @subpackage Customize
 * @since 4.3.0
 */

/**
 * Customize Nav Menus class.
 *
 * Implements menu management in the Customizer.
 *
 * @since 4.3.0
 *
 * @see WP_Customize_Manager
 */
#[AllowDynamicProperties]
final class WP_Customize_Nav_Menus {

	/**
	 * WP_Customize_Manager instance.
	 *
	 * @since 4.3.0
	 * @var WP_Customize_Manager
	 */
	public $manager;

	/**
	 * Original nav menu locations before the theme was switched.
	 *
	 * @since 4.9.0
	 * @var array
	 */
	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;
		}

		add_filter( 'customize_refresh_nonces', array( $this, 'filter_nonces' ) );
		add_action( 'wp_ajax_load-available-menu-items-customizer', array( $this, 'ajax_load_available_items' ) );
		add_action( 'wp_ajax_search-available-menu-items-customizer', array( $this, 'ajax_search_available_items' ) );
		add_action( 'wp_ajax_customize-nav-menus-insert-auto-draft', array( $this, 'ajax_insert_auto_draft_post' ) );
		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
		add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_templates' ) );
		add_action( 'customize_controls_print_footer_scripts', array( $this, 'available_items_template' ) );
		add_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) );
		add_action( 'customize_preview_init', array( $this, 'make_auto_draft_status_previewable' ) );

		// Selective Refresh partials.
		add_filter( 'customize_dynamic_partial_args', array( $this, 'customize_dynamic_partial_args' ), 10, 2 );
	}

	/**
	 * Adds a nonce for customizing menus.
	 *
	 * @since 4.5.0
	 *
	 * @param string[] $nonces Array of nonces.
	 * @return string[] Modified array of nonces.
	 */
	public function filter_nonces( $nonces ) {
		$nonces['customize-menus'] = wp_create_nonce( 'customize-menus' );
		return $nonces;
	}

	/**
	 * Ajax handler for loading available menu items.
	 *
	 * @since 4.3.0
	 */
	public function ajax_load_available_items() {
		check_ajax_referer( 'customize-menus', 'customize-menus-nonce' );

		if ( ! current_user_can( 'edit_theme_options' ) ) {
			wp_die( -1 );
		}

		$all_items  = array();
		$item_types = array();
		if ( isset( $_POST['item_types'] ) && is_array( $_POST['item_types'] ) ) {
			$item_types = wp_unslash( $_POST['item_types'] );
		} elseif ( isset( $_POST['type'] ) && isset( $_POST['object'] ) ) { // Back compat.
			$item_types[] = array(
				'type'   => wp_unslash( $_POST['type'] ),
				'object' => wp_unslash( $_POST['object'] ),
				'page'   => empty( $_POST['page'] ) ? 0 : absint( $_POST['page'] ),
			);
		} else {
			wp_send_json_error( 'nav_menus_missing_type_or_object_parameter' );
		}

		foreach ( $item_types as $item_type ) {
			if ( empty( $item_type['type'] ) || empty( $item_type['object'] ) ) {
				wp_send_json_error( 'nav_menus_missing_type_or_object_parameter' );
			}
			$type   = sanitize_key( $item_type['type'] );
			$object = sanitize_key( $item_type['object'] );
			$page   = empty( $item_type['page'] ) ? 0 : absint( $item_type['page'] );
			$items  = $this->load_available_items_query( $type, $object, $page );
			if ( is_wp_error( $items ) ) {
				wp_send_json_error( $items->get_error_code() );
			}
			$all_items[ $item_type['type'] . ':' . $item_type['object'] ] = $items;
		}

		wp_send_json_success( array( 'items' => $all_items ) );
	}

	/**
	 * Performs the post_type and taxonomy queries for loading available menu items.
	 *
	 * @since 4.3.0
	 *
	 * @param string $object_type Optional. Accepts any custom object type and has built-in support for
	 *                            'post_type' and 'taxonomy'. Default is 'post_type'.
	 * @param string $object_name Optional. Accepts any registered taxonomy or post type name. Default is 'page'.
	 * @param int    $page        Optional. The page number used to generate the query offset. Default is '0'.
	 * @return array|WP_Error An array of menu items on success, a WP_Error object on failure.
	 */
	public function load_available_items_query( $object_type = 'post_type', $object_name = 'page', $page = 0 ) {
		$items = array();

		if ( 'post_type' === $object_type ) {
			$post_type = get_post_type_object( $object_name );
			if ( ! $post_type ) {
				return new WP_Error( 'nav_menus_invalid_post_type' );
			}

			/*
			 * If we're dealing with pages, let's prioritize the Front Page,
			 * Posts Page and Privacy Policy Page at the top of the list.
			 */
			$important_pages   = array();
			$suppress_page_ids = array();
			if ( 0 === $page && 'page' === $object_name ) {
				// Insert Front Page or custom "Home" link.
				$front_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;
				if ( ! empty( $front_page ) ) {
					$front_page_obj      = get_post( $front_page );
					$important_pages[]   = $front_page_obj;
					$suppress_page_ids[] = $front_page_obj->ID;
				} else {
					// Add "Home" link. Treat as a page, but switch to custom on add.
					$items[] = array(
						'id'         => 'home',
						'title'      => _x( 'Home', 'nav menu home label' ),
						'type'       => 'custom',
						'type_label' => __( 'Custom Link' ),
						'object'     => '',
						'url'        => home_url(),
					);
				}

				// Insert Posts Page.
				$posts_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_for_posts' ) : 0;
				if ( ! empty( $posts_page ) ) {
					$posts_page_obj      = get_post( $posts_page );
					$important_pages[]   = $posts_page_obj;
					$suppress_page_ids[] = $posts_page_obj->ID;
				}

				// Insert Privacy Policy Page.
				$privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
				if ( ! empty( $privacy_policy_page_id ) ) {
					$privacy_policy_page = get_post( $privacy_policy_page_id );
					if ( $privacy_policy_page instanceof WP_Post && 'publish' === $privacy_policy_page->post_status ) {
						$important_pages[]   = $privacy_policy_page;
						$suppress_page_ids[] = $privacy_policy_page->ID;
					}
				}
			} elseif ( 'post' !== $object_name && 0 === $page && $post_type->has_archive ) {
				// Add a post type archive link.
				$title   = $post_type->labels->archives;
				$items[] = array(
					'id'             => $object_name . '-archive',
					'title'          => $title,
					'original_title' => $title,
					'type'           => 'post_type_archive',
					'type_label'     => __( 'Post Type Archive' ),
					'object'         => $object_name,
					'url'            => get_post_type_archive_link( $object_name ),
				);
			}

			// Prepend posts with nav_menus_created_posts on first page.
			$posts = array();
			if ( 0 === $page && $this->manager->get_setting( 'nav_menus_created_posts' ) ) {
				foreach ( $this->manager->get_setting( 'nav_menus_created_posts' )->value() as $post_id ) {
					$auto_draft_post = get_post( $post_id );
					if ( $post_type->name === $auto_draft_post->post_type ) {
						$posts[] = $auto_draft_post;
					}
				}
			}

			$args = array(
				'numberposts' => 10,
				'offset'      => 10 * $page,
				'orderby'     => 'date',
				'order'       => 'DESC',
				'post_type'   => $object_name,
			);

			// Add suppression array to arguments for get_posts.
			if ( ! empty( $suppress_page_ids ) ) {
				$args['post__not_in'] = $suppress_page_ids;
			}

			$posts = array_merge(
				$posts,
				$important_pages,
				get_posts( $args )
			);

			foreach ( $posts as $post ) {
				$post_title = $post->post_title;
				if ( '' === $post_title ) {
					/* translators: %d: ID of a post. */
					$post_title = sprintf( __( '#%d (no title)' ), $post->ID );
				}

				$post_type_label = get_post_type_object( $post->post_type )->labels->singular_name;
				$post_states     = get_post_states( $post );
				if ( ! empty( $post_states ) ) {
					$post_type_label = implode( ',', $post_states );
				}

				$title   = html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) );
				$items[] = array(
					'id'             => "post-{$post->ID}",
					'title'          => $title,
					'original_title' => $title,
					'type'           => 'post_type',
					'type_label'     => $post_type_label,
					'object'         => $post->post_type,
					'object_id'      => (int) $post->ID,
					'url'            => get_permalink( (int) $post->ID ),
				);
			}
		} elseif ( 'taxonomy' === $object_type ) {
			$terms = get_terms(
				array(
					'taxonomy'     => $object_name,
					'child_of'     => 0,
					'exclude'      => '',
					'hide_empty'   => false,
					'hierarchical' => 1,
					'include'      => '',
					'number'       => 10,
					'offset'       => 10 * $page,
					'order'        => 'DESC',
					'orderby'      => 'count',
					'pad_counts'   => false,
				)
			);

			if ( is_wp_error( $terms ) ) {
				return $terms;
			}

			foreach ( $terms as $term ) {
				$title   = html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) );
				$items[] = array(
					'id'             => "term-{$term->term_id}",
					'title'          => $title,
					'original_title' => $title,
					'type'           => 'taxonomy',
					'type_label'     => get_taxonomy( $term->taxonomy )->labels->singular_name,
					'object'         => $term->taxonomy,
					'object_id'      => (int) $term->term_id,
					'url'            => get_term_link( (int) $term->term_id, $term->taxonomy ),
				);
			}
		}

		/**
		 * Filters the available menu items.
		 *
		 * @since 4.3.0
		 *
		 * @param array  $items       The array of menu items.
		 * @param string $object_type The object type.
		 * @param string $object_name The object name.
		 * @param int    $page        The current page number.
		 */
		$items = apply_filters( 'customize_nav_menu_available_items', $items, $object_type, $object_name, $page );

		return $items;
	}

	/**
	 * Ajax handler for searching available menu items.
	 *
	 * @since 4.3.0
	 */
	public function ajax_search_available_items() {
		check_ajax_referer( 'customize-menus', 'customize-menus-nonce' );

		if ( ! current_user_can( 'edit_theme_options' ) ) {
			wp_die( -1 );
		}

		if ( empty( $_POST['search'] ) ) {
			wp_send_json_error( 'nav_menus_missing_search_parameter' );
		}

		$p = isset( $_POST['page'] ) ? absint( $_POST['page'] ) : 0;
		if ( $p < 1 ) {
			$p = 1;
		}

		$s     = sanitize_text_field( wp_unslash( $_POST['search'] ) );
		$items = $this->search_available_items_query(
			array(
				'pagenum' => $p,
				's'       => $s,
			)
		);

		if ( empty( $items ) ) {
			wp_send_json_error( array( 'message' => __( 'No results found.' ) ) );
		} else {
			wp_send_json_success( array( 'items' => $items ) );
		}
	}

	/**
	 * Performs post queries for available-item searching.
	 *
	 * Based on WP_Editor::wp_link_query().
	 *
	 * @since 4.3.0
	 *
	 * @param array $args Optional. Accepts 'pagenum' and 's' (search) arguments.
	 * @return array Menu items.
	 */
	public function search_available_items_query( $args = array() ) {
		$items = array();

		$post_type_objects = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
		$query             = array(
			'post_type'              => array_keys( $post_type_objects ),
			'suppress_filters'       => true,
			'update_post_term_cache' => false,
			'update_post_meta_cache' => false,
			'post_status'            => 'publish',
			'posts_per_page'         => 20,
		);

		$args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1;
		$query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;

		if ( isset( $args['s'] ) ) {
			$query['s'] = $args['s'];
		}

		$posts = array();

		// Prepend list of posts with nav_menus_created_posts search results on first page.
		$nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' );
		if ( 1 === $args['pagenum'] && $nav_menus_created_posts_setting && count( $nav_menus_created_posts_setting->value() ) > 0 ) {
			$stub_post_query = new WP_Query(
				array_merge(
					$query,
					array(
						'post_status'    => 'auto-draft',
						'post__in'       => $nav_menus_created_posts_setting->value(),
						'posts_per_page' => -1,
					)
				)
			);
			$posts           = array_merge( $posts, $stub_post_query->posts );
		}

		// Query posts.
		$get_posts = new WP_Query( $query );
		$posts     = array_merge( $posts, $get_posts->posts );

		// Create items for posts.
		foreach ( $posts as $post ) {
			$post_title = $post->post_title;
			if ( '' === $post_title ) {
				/* translators: %d: ID of a post. */
				$post_title = sprintf( __( '#%d (no title)' ), $post->ID );
			}

			$post_type_label = $post_type_objects[ $post->post_type ]->labels->singular_name;
			$post_states     = get_post_states( $post );
			if ( ! empty( $post_states ) ) {
				$post_type_label = implode( ',', $post_states );
			}

			$items[] = array(
				'id'         => 'post-' . $post->ID,
				'title'      => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ),
				'type'       => 'post_type',
				'type_label' => $post_type_label,
				'object'     => $post->post_type,
				'object_id'  => (int) $post->ID,
				'url'        => get_permalink( (int) $post->ID ),
			);
		}

		// Query taxonomy terms.
		$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'names' );
		$terms      = get_terms(
			array(
				'taxonomies' => $taxonomies,
				'name__like' => $args['s'],
				'number'     => 20,
				'hide_empty' => false,
				'offset'     => 20 * ( $args['pagenum'] - 1 ),
			)
		);

		// Check if any taxonomies were found.
		if ( ! empty( $terms ) ) {
			foreach ( $terms as $term ) {
				$items[] = array(
					'id'         => 'term-' . $term->term_id,
					'title'      => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
					'type'       => 'taxonomy',
					'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
					'object'     => $term->taxonomy,
					'object_id'  => (int) $term->term_id,
					'url'        => get_term_link( (int) $term->term_id, $term->taxonomy ),
				);
			}
		}

		// Add "Home" link if search term matches. Treat as a page, but switch to custom on add.
		if ( isset( $args['s'] ) ) {
			// Only insert custom "Home" link if there's no Front Page
			$front_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;
			if ( empty( $front_page ) ) {
				$title   = _x( 'Home', 'nav menu home label' );
				$matches = function_exists( 'mb_stripos' ) ? false !== mb_stripos( $title, $args['s'] ) : false !== stripos( $title, $args['s'] );
				if ( $matches ) {
					$items[] = array(
						'id'         => 'home',
						'title'      => $title,
						'type'       => 'custom',
						'type_label' => __( 'Custom Link' ),
						'object'     => '',
						'url'        => home_url(),
					);
				}
			}
		}

		/**
		 * Filters the available menu items during a search request.
		 *
		 * @since 4.5.0
		 *
		 * @param array $items The array of menu items.
		 * @param array $args  Includes 'pagenum' and 's' (search) arguments.
		 */
		$items = apply_filters( 'customize_nav_menu_searched_items', $items, $args );

		return $items;
	}

	/**
	 * Enqueues scripts and styles for Customizer pane.
	 *
	 * @since 4.3.0
	 */
	public function enqueue_scripts() {
		wp_enqueue_style( 'customize-nav-menus' );
		wp_enqueue_script( 'customize-nav-menus' );

		$temp_nav_menu_setting      = new WP_Customize_Nav_Menu_Setting( $this->manager, 'nav_menu[-1]' );
		$temp_nav_menu_item_setting = new WP_Customize_Nav_Menu_Item_Setting( $this->manager, 'nav_menu_item[-1]' );

		$num_locations = count( get_registered_nav_menus() );

		if ( 1 === $num_locations ) {
			$locations_description = __( 'Your theme can display menus in one location.' );
		} else {
			/* translators: %s: Number of menu locations. */
			$locations_description = sprintf( _n( 'Your theme can display menus in %s location.', 'Your theme can display menus in %s locations.', $num_locations ), number_format_i18n( $num_locations ) );
		}

		// Pass data to JS.
		$settings = array(
			'allMenus'                 => wp_get_nav_menus(),
			'itemTypes'                => $this->available_item_types(),
			'l10n'                     => array(
				'untitled'               => _x( '(no label)', 'missing menu item navigation label' ),
				'unnamed'                => _x( '(unnamed)', 'Missing menu name.' ),
				'custom_label'           => __( 'Custom Link' ),
				'page_label'             => get_post_type_object( 'page' )->labels->singular_name,
				/* translators: %s: Menu location. */
				'menuLocation'           => _x( '(Currently set to: %s)', 'menu' ),
				'locationsTitle'         => 1 === $num_locations ? __( 'Menu Location' ) : __( 'Menu Locations' ),
				'locationsDescription'   => $locations_description,
				'menuNameLabel'          => __( 'Menu Name' ),
				'newMenuNameDescription' => __( 'If your theme has multiple menus, giving them clear names will help you manage them.' ),
				'itemAdded'              => __( 'Menu item added' ),
				'itemDeleted'            => __( 'Menu item deleted' ),
				'menuAdded'              => __( 'Menu created' ),
				'menuDeleted'            => __( 'Menu deleted' ),
				'movedUp'                => __( 'Menu item moved up' ),
				'movedDown'              => __( 'Menu item moved down' ),
				'movedLeft'              => __( 'Menu item moved out of submenu' ),
				'movedRight'             => __( 'Menu item is now a sub-item' ),
				/* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
				'customizingMenus'       => sprintf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'nav_menus' )->title ) ),
				/* translators: %s: Title of an invalid menu item. */
				'invalidTitleTpl'        => __( '%s (Invalid)' ),
				/* translators: %s: Title of a menu item in draft status. */
				'pendingTitleTpl'        => __( '%s (Pending)' ),
				/* translators: %d: Number of menu items found. */
				'itemsFound'             => __( 'Number of items found: %d' ),
				/* translators: %d: Number of additional menu items found. */
				'itemsFoundMore'         => __( 'Additional items found: %d' ),
				'itemsLoadingMore'       => __( 'Loading more results... please wait.' ),
				'reorderModeOn'          => __( 'Reorder mode enabled' ),
				'reorderModeOff'         => __( 'Reorder mode closed' ),
				'reorderLabelOn'         => esc_attr__( 'Reorder menu items' ),
				'reorderLabelOff'        => esc_attr__( 'Close reorder mode' ),
			),
			'settingTransport'         => 'postMessage',
			'phpIntMax'                => PHP_INT_MAX,
			'defaultSettingValues'     => array(
				'nav_menu'      => $temp_nav_menu_setting->default,
				'nav_menu_item' => $temp_nav_menu_item_setting->default,
			),
			'locationSlugMappedToName' => get_registered_nav_menus(),
		);

		$data = sprintf( 'var _wpCustomizeNavMenusSettings = %s;', wp_json_encode( $settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) );
		wp_scripts()->add_data( 'customize-nav-menus', 'data', $data );

		// This is copied from nav-menus.php, and it has an unfortunate object name of `menus`.
		$nav_menus_l10n = array(
			'oneThemeLocationNoMenus' => null,
			'moveUp'                  => __( 'Move up one' ),
			'moveDown'                => __( 'Move down one' ),
			'moveToTop'               => __( 'Move to the top' ),
			/* translators: %s: Previous item name. */
			'moveUnder'               => __( 'Move under %s' ),
			/* translators: %s: Previous item name. */
			'moveOutFrom'             => __( 'Move out from under %s' ),
			/* translators: %s: Previous item name. */
			'under'                   => __( 'Under %s' ),
			/* translators: %s: Previous item name. */
			'outFrom'                 => __( 'Out from under %s' ),
			/* translators: 1: Item name, 2: Item type, 3: Item index, 4: Total items. */
			'menuFocus'               => __( 'Edit %1$s (%2$s, %3$d of %4$d)' ),
			/* translators: 1: Item name, 2: Item type, 3: Item index, 4: Total items, 5: Item parent. */
			'subMenuFocus'            => __( 'Edit %1$s (%2$s, sub-item %3$d of %4$d under %5$s)' ),
			/* translators: 1: Item name, 2: Item type, 3: Item index, 4: Total items, 5: Item parent, 6: Item depth. */
			'subMenuMoreDepthFocus'   => __( 'Edit %1$s (%2$s, sub-item %3$d of %4$d under %5$s, level %6$d)' ),
		);
		wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n );
	}

	/**
	 * Filters a dynamic setting's constructor args.
	 *
	 * For a dynamic setting to be registered, this filter must be employed
	 * to override the default false value with an array of args to pass to
	 * the WP_Customize_Setting constructor.
	 *
	 * @since 4.3.0
	 *
	 * @param false|array $setting_args The arguments to the WP_Customize_Setting constructor.
	 * @param string      $setting_id   ID for dynamic setting, usually coming from `$_POST['customized']`.
	 * @return array|false
	 */
	public function filter_dynamic_setting_args( $setting_args, $setting_id ) {
		if ( preg_match( WP_Customize_Nav_Menu_Setting::ID_PATTERN, $setting_id ) ) {
			$setting_args = array(
				'type'      => WP_Customize_Nav_Menu_Setting::TYPE,
				'transport' => 'postMessage',
			);
		} elseif ( preg_match( WP_Customize_Nav_Menu_Item_Setting::ID_PATTERN, $setting_id ) ) {
			$setting_args = array(
				'type'      => WP_Customize_Nav_Menu_Item_Setting::TYPE,
				'transport' => 'postMessage',
			);
		}
		return $setting_args;
	}

	/**
	 * Allows non-statically created settings to be constructed with custom WP_Customize_Setting subclass.
	 *
	 * @since 4.3.0
	 *
	 * @param string $setting_class WP_Customize_Setting or a subclass.
	 * @param string $setting_id    ID for dynamic setting, usually coming from `$_POST['customized']`.
	 * @param array  $setting_args  WP_Customize_Setting or a subclass.
	 * @return string
	 */
	public function filter_dynamic_setting_class( $setting_class, $setting_id, $setting_args ) {
		unset( $setting_id );

		if ( ! empty( $setting_args['type'] ) && WP_Customize_Nav_Menu_Setting::TYPE === $setting_args['type'] ) {
			$setting_class = 'WP_Customize_Nav_Menu_Setting';
		} elseif ( ! empty( $setting_args['type'] ) && WP_Customize_Nav_Menu_Item_Setting::TYPE === $setting_args['type'] ) {
			$setting_class = 'WP_Customize_Nav_Menu_Item_Setting';
		}
		return $setting_class;
	}

	/**
	 * Adds the customizer settings and controls.
	 *
	 * @since 4.3.0
	 */
	public function customize_register() {
		$changeset = $this->manager->unsanitized_post_values();

		// Preview settings for nav menus early so that the sections and controls will be added properly.
		$nav_menus_setting_ids = array();
		foreach ( array_keys( $changeset ) as $setting_id ) {
			if ( preg_match( '/^(nav_menu_locations|nav_menu|nav_menu_item)\[/', $setting_id ) ) {
				$nav_menus_setting_ids[] = $setting_id;
			}
		}
		$settings = $this->manager->add_dynamic_settings( $nav_menus_setting_ids );
		if ( $this->manager->settings_previewed() ) {
			foreach ( $settings as $setting ) {
				$setting->preview();
			}
		}

		// Require JS-rendered control types.
		$this->manager->register_panel_type( 'WP_Customize_Nav_Menus_Panel' );
		$this->manager->register_control_type( 'WP_Customize_Nav_Menu_Control' );
		$this->manager->register_control_type( 'WP_Customize_Nav_Menu_Name_Control' );
		$this->manager->register_control_type( 'WP_Customize_Nav_Menu_Locations_Control' );
		$this->manager->register_control_type( 'WP_Customize_Nav_Menu_Auto_Add_Control' );
		$this->manager->register_control_type( 'WP_Customize_Nav_Menu_Item_Control' );

		// Create a panel for Menus.
		$description = '<p>' . __( 'This panel is used for managing navigation menus for content you have already published on your site. You can create menus and add items for existing content such as pages, posts, categories, tags, formats, or custom links.' ) . '</p>';
		if ( current_theme_supports( 'widgets' ) ) {
			$description .= '<p>' . sprintf(
				/* translators: %s: URL to the Widgets panel of the Customizer. */
				__( 'Menus can be displayed in locations defined by your theme or in <a href="%s">widget areas</a> by adding a &#8220;Navigation Menu&#8221; widget.' ),
				"javascript:wp.customize.panel( 'widgets' ).focus();"
			) . '</p>';
		} else {
			$description .= '<p>' . __( 'Menus can be displayed in locations defined by your theme.' ) . '</p>';
		}

		/*
		 * Once multiple theme supports are allowed in WP_Customize_Panel,
		 * this panel can be restricted to themes that support menus or widgets.
		 */
		$this->manager->add_panel(
			new WP_Customize_Nav_Menus_Panel(
				$this->manager,
				'nav_menus',
				array(
					'title'       => __( 'Menus' ),
					'description' => $description,
					'priority'    => 100,
				)
			)
		);
		$menus = wp_get_nav_menus();

		// Menu locations.
		$locations     = get_registered_nav_menus();
		$num_locations = count( $locations );

		if ( 1 === $num_locations ) {
			$description = '<p>' . __( 'Your theme can display menus in one location. Select which menu you would like to use.' ) . '</p>';
		} else {
			/* translators: %s: Number of menu locations. */
			$description = '<p>' . sprintf( _n( 'Your theme can display menus in %s location. Select which menu you would like to use.', 'Your theme can display menus in %s locations. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . '</p>';
		}

		if ( current_theme_supports( 'widgets' ) ) {
			/* translators: URL to the Widgets panel of the Customizer. */
			$description .= '<p>' . sprintf( __( 'If your theme has widget areas, you can also add menus there. Visit the <a href="%s">Widgets panel</a> and add a &#8220;Navigation Menu widget&#8221; to display a menu in a sidebar or footer.' ), "javascript:wp.customize.panel( 'widgets' ).focus();" ) . '</p>';
		}

		$this->manager->add_section(
			'menu_locations',
			array(
				'title'       => 1 === $num_locations ? _x( 'View Location', 'menu locations' ) : _x( 'View All Locations', 'menu locations' ),
				'panel'       => 'nav_menus',
				'priority'    => 30,
				'description' => $description,
			)
		);

		$choices = array( '0' => __( '&mdash; Select &mdash;' ) );
		foreach ( $menus as $menu ) {
			$choices[ $menu->term_id ] = wp_html_excerpt( $menu->name, 40, '&hellip;' );
		}

		// Attempt to re-map the nav menu location assignments when previewing a theme switch.
		$mapped_nav_menu_locations = array();
		if ( ! $this->manager->is_theme_active() ) {
			$theme_mods = get_option( 'theme_mods_' . $this->manager->get_stylesheet(), array() );

			// If there is no data from a previous activation, start fresh.
			if ( empty( $theme_mods['nav_menu_locations'] ) ) {
				$theme_mods['nav_menu_locations'] = array();
			}

			$mapped_nav_menu_locations = wp_map_nav_menu_locations( $theme_mods['nav_menu_locations'], $this->original_nav_menu_locations );
		}

		foreach ( $locations as $location => $description ) {
			$setting_id = "nav_menu_locations[{$location}]";

			$setting = $this->manager->get_setting( $setting_id );
			if ( $setting ) {
				$setting->transport = 'postMessage';
				remove_filter( "customize_sanitize_{$setting_id}", 'absint' );
				add_filter( "customize_sanitize_{$setting_id}", array( $this, 'intval_base10' ) );
			} else {
				$this->manager->add_setting(
					$setting_id,
					array(
						'sanitize_callback' => array( $this, 'intval_base10' ),
						'theme_supports'    => 'menus',
						'type'              => 'theme_mod',
						'transport'         => 'postMessage',
						'default'           => 0,
					)
				);
			}

			// Override the assigned nav menu location if mapped during previewed theme switch.
			if ( empty( $changeset[ $setting_id ] ) && isset( $mapped_nav_menu_locations[ $location ] ) ) {
				$this->manager->set_post_value( $setting_id, $mapped_nav_menu_locations[ $location ] );
			}

			$this->manager->add_control(
				new WP_Customize_Nav_Menu_Location_Control(
					$this->manager,
					$setting_id,
					array(
						'label'       => $description,
						'location_id' => $location,
						'section'     => 'menu_locations',
						'choices'     => $choices,
					)
				)
			);
		}

		// Used to denote post states for special pages.
		if ( ! function_exists( 'get_post_states' ) ) {
			require_once ABSPATH . 'wp-admin/includes/template.php';
		}

		// Register each menu as a Customizer section, and add each menu item to each menu.
		foreach ( $menus as $menu ) {
			$menu_id = $menu->term_id;

			// Create a section for each menu.
			$section_id = 'nav_menu[' . $menu_id . ']';
			$this->manager->add_section(
				new WP_Customize_Nav_Menu_Section(
					$this->manager,
					$section_id,
					array(
						'title'    => html_entity_decode( $menu->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
						'priority' => 10,
						'panel'    => 'nav_menus',
					)
				)
			);

			$nav_menu_setting_id = 'nav_menu[' . $menu_id . ']';
			$this->manager->add_setting(
				new WP_Customize_Nav_Menu_Setting(
					$this->manager,
					$nav_menu_setting_id,
					array(
						'transport' => 'postMessage',
					)
				)
			);

			// Add the menu contents.
			$menu_items = (array) wp_get_nav_menu_items( $menu_id );

			foreach ( array_values( $menu_items ) as $i => $item ) {

				// Create a setting for each menu item (which doesn't actually manage data, currently).
				$menu_item_setting_id = 'nav_menu_item[' . $item->ID . ']';

				$value = (array) $item;
				if ( empty( $value['post_title'] ) ) {
					$value['title'] = '';
				}

				$value['nav_menu_term_id'] = $menu_id;
				$this->manager->add_setting(
					new WP_Customize_Nav_Menu_Item_Setting(
						$this->manager,
						$menu_item_setting_id,
						array(
							'value'     => $value,
							'transport' => 'postMessage',
						)
					)
				);

				// Create a control for each menu item.
				$this->manager->add_control(
					new WP_Customize_Nav_Menu_Item_Control(
						$this->manager,
						$menu_item_setting_id,
						array(
							'label'    => $item->title,
							'section'  => $section_id,
							'priority' => 10 + $i,
						)
					)
				);
			}

			// Note: other controls inside of this section get added dynamically in JS via the MenuSection.ready() function.
		}

		// Add the add-new-menu section and controls.
		$this->manager->add_section(
			'add_menu',
			array(
				'type'     => 'new_menu',
				'title'    => __( 'New Menu' ),
				'panel'    => 'nav_menus',
				'priority' => 20,
			)
		);

		$this->manager->add_setting(
			new WP_Customize_Filter_Setting(
				$this->manager,
				'nav_menus_created_posts',
				array(
					'transport'         => 'postMessage',
					'type'              => 'option', // To prevent theme prefix in changeset.
					'default'           => array(),
					'sanitize_callback' => array( $this, 'sanitize_nav_menus_created_posts' ),
				)
			)
		);
	}

	/**
	 * Gets the base10 intval.
	 *
	 * This is used as a setting's sanitize_callback; we can't use just plain
	 * intval because the second argument is not what intval() expects.
	 *
	 * @since 4.3.0
	 *
	 * @param mixed $value Number to convert.
	 * @return int Integer.
	 */
	public function intval_base10( $value ) {
		return intval( $value, 10 );
	}

	/**
	 * Returns an array of all the available item types.
	 *
	 * @since 4.3.0
	 * @since 4.7.0  Each array item now includes a `$type_label` in addition to `$title`, `$type`, and `$object`.
	 *
	 * @return array The available menu item types.
	 */
	public function available_item_types() {
		$item_types = array();

		$post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
		if ( $post_types ) {
			foreach ( $post_types as $slug => $post_type ) {
				$item_types[] = array(
					'title'      => $post_type->labels->name,
					'type_label' => $post_type->labels->singular_name,
					'type'       => 'post_type',
					'object'     => $post_type->name,
				);
			}
		}

		$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'objects' );
		if ( $taxonomies ) {
			foreach ( $taxonomies as $slug => $taxonomy ) {
				if ( 'post_format' === $taxonomy && ! current_theme_supports( 'post-formats' ) ) {
					continue;
				}
				$item_types[] = array(
					'title'      => $taxonomy->labels->name,
					'type_label' => $taxonomy->labels->singular_name,
					'type'       => 'taxonomy',
					'object'     => $taxonomy->name,
				);
			}
		}

		/**
		 * Filters the available menu item types.
		 *
		 * @since 4.3.0
		 * @since 4.7.0  Each array item now includes a `$type_label` in addition to `$title`, `$type`, and `$object`.
		 *
		 * @param array $item_types Navigation menu item types.
		 */
		$item_types = apply_filters( 'customize_nav_menu_available_item_types', $item_types );

		return $item_types;
	}

	/**
	 * Adds a new `auto-draft` post.
	 *
	 * @since 4.7.0
	 *
	 * @param array $postarr {
	 *     Post array. Note that post_status is overridden to be `auto-draft`.
	 *
	 *     @type string $post_title   Post title. Required.
	 *     @type string $post_type    Post type. Required.
	 *     @type string $post_name    Post name.
	 *     @type string $post_content Post content.
	 * }
	 * @return WP_Post|WP_Error Inserted auto-draft post object or error.
	 */
	public function insert_auto_draft_post( $postarr ) {
		if ( ! isset( $postarr['post_type'] ) ) {
			return new WP_Error( 'unknown_post_type', __( 'Invalid post type.' ) );
		}
		if ( empty( $postarr['post_title'] ) ) {
			return new WP_Error( 'empty_title', __( 'Empty title.' ) );
		}
		if ( ! empty( $postarr['post_status'] ) ) {
			return new WP_Error( 'status_forbidden', __( 'Status is forbidden.' ) );
		}

		/*
		 * If the changeset is a draft, this will change to draft the next time the changeset
		 * is updated; otherwise, auto-draft will persist in autosave revisions, until save.
		 */
		$postarr['post_status'] = 'auto-draft';

		// Auto-drafts are allowed to have empty post_names, so it has to be explicitly set.
		if ( empty( $postarr['post_name'] ) ) {
			$postarr['post_name'] = sanitize_title( $postarr['post_title'] );
		}
		if ( ! isset( $postarr['meta_input'] ) ) {
			$postarr['meta_input'] = array();
		}
		$postarr['meta_input']['_customize_draft_post_name'] = $postarr['post_name'];
		$postarr['meta_input']['_customize_changeset_uuid']  = $this->manager->changeset_uuid();
		unset( $postarr['post_name'] );

		add_filter( 'wp_insert_post_empty_content', '__return_false', 1000 );
		$r = wp_insert_post( wp_slash( $postarr ), true );
		remove_filter( 'wp_insert_post_empty_content', '__return_false', 1000 );

		if ( is_wp_error( $r ) ) {
			return $r;
		} else {
			return get_post( $r );
		}
	}

	/**
	 * Ajax handler for adding a new auto-draft post.
	 *
	 * @since 4.7.0
	 */
	public function ajax_insert_auto_draft_post() {
		if ( ! check_ajax_referer( 'customize-menus', 'customize-menus-nonce', false ) ) {
			wp_send_json_error( 'bad_nonce', 400 );
		}

		if ( ! current_user_can( 'customize' ) ) {
			wp_send_json_error( 'customize_not_allowed', 403 );
		}

		if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) {
			wp_send_json_error( 'missing_params', 400 );
		}

		$params         = wp_unslash( $_POST['params'] );
		$illegal_params = array_diff( array_keys( $params ), array( 'post_type', 'post_title' ) );
		if ( ! empty( $illegal_params ) ) {
			wp_send_json_error( 'illegal_params', 400 );
		}

		$params = array_merge(
			array(
				'post_type'  => '',
				'post_title' => '',
			),
			$params
		);

		if ( empty( $params['post_type'] ) || ! post_type_exists( $params['post_type'] ) ) {
			status_header( 400 );
			wp_send_json_error( 'missing_post_type_param' );
		}

		$post_type_object = get_post_type_object( $params['post_type'] );
		if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) {
			status_header( 403 );
			wp_send_json_error( 'insufficient_post_permissions' );
		}

		$params['post_title'] = trim( $params['post_title'] );
		if ( '' === $params['post_title'] ) {
			status_header( 400 );
			wp_send_json_error( 'missing_post_title' );
		}

		$r = $this->insert_auto_draft_post( $params );
		if ( is_wp_error( $r ) ) {
			$error = $r;
			if ( ! empty( $post_type_object->labels->singular_name ) ) {
				$singular_name = $post_type_object->labels->singular_name;
			} else {
				$singular_name = __( 'Post' );
			}

			$data = array(
				/* translators: 1: Post type name, 2: Error message. */
				'message' => sprintf( __( '%1$s could not be created: %2$s' ), $singular_name, $error->get_error_message() ),
			);
			wp_send_json_error( $data );
		} else {
			$post = $r;
			$data = array(
				'post_id' => $post->ID,
				'url'     => get_permalink( $post->ID ),
			);
			wp_send_json_success( $data );
		}
	}

	/**
	 * Prints the JavaScript templates used to render Menu Customizer components.
	 *
	 * Templates are imported into the JS use wp.template.
	 *
	 * @since 4.3.0
	 */
	public function print_templates() {
		?>
		<script type="text/html" id="tmpl-available-menu-item">
			<li id="menu-item-tpl-{{ data.id }}" class="menu-item-tpl" data-menu-item-id="{{ data.id }}">
				<div class="menu-item-bar">
					<div class="menu-item-handle">
						<span class="item-type" aria-hidden="true">{{ data.type_label }}</span>
						<span class="item-title" aria-hidden="true">
							<span class="menu-item-title<# if ( ! data.title ) { #> no-title<# } #>">{{ data.title || wp.customize.Menus.data.l10n.untitled }}</span>
						</span>
						<button type="button" class="button-link item-add">
							<span class="screen-reader-text">
							<?php
								/* translators: Hidden accessibility text. 1: Title of a menu item, 2: Type of a menu item. */
								printf( __( 'Add to menu: %1$s (%2$s)' ), '{{ data.title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.type_label }}' );
							?>
							</span>
						</button>
					</div>
				</div>
			</li>
		</script>

		<script type="text/html" id="tmpl-menu-item-reorder-nav">
			<div class="menu-item-reorder-nav">
				<?php
				printf(
					'<button type="button" class="menus-move-up">%1$s</button><button type="button" class="menus-move-down">%2$s</button><button type="button" class="menus-move-left">%3$s</button><button type="button" class="menus-move-right">%4$s</button>',
					__( 'Move up' ),
					__( 'Move down' ),
					__( 'Move one level up' ),
					__( 'Move one level down' )
				);
				?>
			</div>
		</script>

		<script type="text/html" id="tmpl-nav-menu-delete-button">
			<div class="menu-delete-item">
				<button type="button" class="button-link button-link-delete">
					<?php _e( 'Delete Menu' ); ?>
				</button>
			</div>
		</script>

		<script type="text/html" id="tmpl-nav-menu-submit-new-button">
			<p id="customize-new-menu-submit-description"><?php _e( 'Click &#8220;Next&#8221; to start adding links to your new menu.' ); ?></p>
			<button id="customize-new-menu-submit" type="button" class="button" aria-describedby="customize-new-menu-submit-description"><?php _e( 'Next' ); ?></button>
		</script>

		<script type="text/html" id="tmpl-nav-menu-locations-header">
			<span class="customize-control-title customize-section-title-menu_locations-heading">{{ data.l10n.locationsTitle }}</span>
			<p class="customize-control-description customize-section-title-menu_locations-description">{{ data.l10n.locationsDescription }}</p>
		</script>

		<script type="text/html" id="tmpl-nav-menu-create-menu-section-title">
			<p class="add-new-menu-notice">
				<?php _e( 'It does not look like your site has any menus yet. Want to build one? Click the button to start.' ); ?>
			</p>
			<p class="add-new-menu-notice">
				<?php _e( 'You&#8217;ll create a menu, assign it a location, and add menu items like links to pages and categories. If your theme has multiple menu areas, you might need to create more than one.' ); ?>
			</p>
			<h3>
				<button type="button" class="button customize-add-menu-button">
					<?php _e( 'Create New Menu' ); ?>
				</button>
			</h3>
		</script>
		<?php
	}

	/**
	 * Prints the HTML template used to render the add-menu-item frame.
	 *
	 * @since 4.3.0
	 */
	public function available_items_template() {
		?>
		<div id="available-menu-items" class="accordion-container">
			<div class="customize-section-title">
				<button type="button" class="customize-section-back" tabindex="-1">
					<span class="screen-reader-text">
						<?php
						/* translators: Hidden accessibility text. */
						_e( 'Back' );
						?>
					</span>
				</button>
				<h3>
					<span class="customize-action">
						<?php
							/* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
							printf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'nav_menus' )->title ) );
						?>
					</span>
					<?php _e( 'Add Menu Items' ); ?>
				</h3>
			</div>
			<div id="available-menu-items-search" class="accordion-section cannot-expand">
				<div class="accordion-section-title">
					<label for="menu-items-search"><?php _e( 'Search Menu Items' ); ?></label>
					<input type="text" id="menu-items-search" aria-describedby="menu-items-search-desc" />
					<p class="screen-reader-text" id="menu-items-search-desc">
						<?php
						/* translators: Hidden accessibility text. */
						_e( 'The search results will be updated as you type.' );
						?>
					</p>
					<span class="spinner"></span>
					<div class="search-icon" aria-hidden="true"></div>
					<button type="button" class="clear-results"><span class="screen-reader-text">
						<?php
						/* translators: Hidden accessibility text. */
						_e( 'Clear Results' );
						?>
					</span></button>
				</div>
				<ul class="accordion-section-content available-menu-items-list" data-type="search"></ul>
			</div>
			<?php

			// Ensure the page post type comes first in the list.
			$item_types     = $this->available_item_types();
			$page_item_type = null;
			foreach ( $item_types as $i => $item_type ) {
				if ( isset( $item_type['object'] ) && 'page' === $item_type['object'] ) {
					$page_item_type = $item_type;
					unset( $item_types[ $i ] );
				}
			}

			$this->print_custom_links_available_menu_item();
			if ( $page_item_type ) {
				$this->print_post_type_container( $page_item_type );
			}
			// Containers for per-post-type item browsing; items are added with JS.
			foreach ( $item_types as $item_type ) {
				$this->print_post_type_container( $item_type );
			}
			?>
		</div><!-- #available-menu-items -->
		<?php
	}

	/**
	 * Prints the markup for new menu items.
	 *
	 * To be used in the template #available-menu-items.
	 *
	 * @since 4.7.0
	 *
	 * @param array $available_item_type Menu item data to output, including title, type, and label.
	 */
	protected function print_post_type_container( $available_item_type ) {
		$id = sprintf( 'available-menu-items-%s-%s', $available_item_type['type'], $available_item_type['object'] );
		?>
		<div id="<?php echo esc_attr( $id ); ?>" class="accordion-section">
			<h4 class="accordion-section-title">
				<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls="<?php echo esc_attr( $id ); ?>-content">
					<?php echo esc_html( $available_item_type['title'] ); ?>
					<span class="spinner"></span>
					<span class="no-items"><?php _e( 'No items' ); ?></span>
					<span class="toggle-indicator" aria-hidden="true"></span>
				</button>
			</h4>
			<div class="accordion-section-content" id="<?php echo esc_attr( $id ); ?>-content">
				<?php if ( 'post_type' === $available_item_type['type'] ) : ?>
					<?php $post_type_obj = get_post_type_object( $available_item_type['object'] ); ?>
					<?php if ( current_user_can( $post_type_obj->cap->create_posts ) && current_user_can( $post_type_obj->cap->publish_posts ) ) : ?>
						<div class="new-content-item-wrapper">
							<label for="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>"><?php echo esc_html( $post_type_obj->labels->add_new_item ); ?></label>
							<div class="new-content-item">
								<input type="text" id="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>" class="create-item-input form-required">
								<button type="button" class="button add-content"><?php _e( 'Add' ); ?></button>
							</div>
							<span id="create-input-<?php echo esc_attr( $available_item_type['object'] ); ?>-error" class="create-item-error error-message" style="display: none;"><?php _e( 'Please enter an item title' ); ?></span>

						</div>
					<?php endif; ?>
				<?php endif; ?>
				<ul class="available-menu-items-list" data-type="<?php echo esc_attr( $available_item_type['type'] ); ?>" data-object="<?php echo esc_attr( $available_item_type['object'] ); ?>" data-type_label="<?php echo esc_attr( $available_item_type['type_label'] ?? $available_item_type['type'] ); ?>"></ul>
			</div>
		</div>
		<?php
	}

	/**
	 * Prints the markup for available menu item custom links.
	 *
	 * @since 4.7.0
	 */
	protected function print_custom_links_available_menu_item() {
		?>
		<div id="new-custom-menu-item" class="accordion-section">
			<h4 class="accordion-section-title">
				<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls="new-custom-menu-item-content">
					<?php _e( 'Custom Links' ); ?>
					<span class="toggle-indicator" aria-hidden="true"></span>
				</button>
			</h4>
			<div class="accordion-section-content customlinkdiv" id="new-custom-menu-item-content">
				<input type="hidden" value="custom" id="custom-menu-item-type" name="menu-item[-1][menu-item-type]" />
				<p id="menu-item-url-wrap" class="wp-clearfix">
					<label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
					<input id="custom-menu-item-url" name="menu-item[-1][menu-item-url]" type="text" class="code menu-item-textbox" placeholder="https://">
					<span id="custom-url-error" class="error-message" style="display: none;"><?php _e( 'Please provide a valid link.' ); ?></span>
				</p>
				<p id="menu-item-name-wrap" class="wp-clearfix">
					<label class="howto" for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label>
					<input id="custom-menu-item-name" name="menu-item[-1][menu-item-title]" type="text" class="regular-text menu-item-textbox">
					<span id="custom-name-error" class="error-message" style="display: none;"><?php _e( 'The link text cannot be empty.' ); ?></span>
				</p>
				<p class="button-controls">
					<span class="add-to-menu">
						<input type="submit" class="button submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-custom-menu-item" id="custom-menu-item-submit">
						<span class="spinner"></span>
					</span>
				</p>
			</div>
		</div>
		<?php
	}

	//
	// Start functionality specific to partial-refresh of menu changes in Customizer preview.
	//

	/**
	 * Nav menu args used for each instance, keyed by the args HMAC.
	 *
	 * @since 4.3.0
	 * @var array
	 */
	public $preview_nav_menu_instance_args = array();

	/**
	 * Filters arguments for dynamic nav_menu selective refresh partials.
	 *
	 * @since 4.5.0
	 *
	 * @param array|false $partial_args Partial args.
	 * @param string      $partial_id   Partial ID.
	 * @return array Partial args.
	 */
	public function customize_dynamic_partial_args( $partial_args, $partial_id ) {

		if ( preg_match( '/^nav_menu_instance\[[0-9a-f]{32}\]$/', $partial_id ) ) {
			if ( false === $partial_args ) {
				$partial_args = array();
			}
			$partial_args = array_merge(
				$partial_args,
				array(
					'type'                => 'nav_menu_instance',
					'render_callback'     => array( $this, 'render_nav_menu_partial' ),
					'container_inclusive' => true,
					'settings'            => array(), // Empty because the nav menu instance may relate to a menu or a location.
					'capability'          => 'edit_theme_options',
				)
			);
		}

		return $partial_args;
	}

	/**
	 * Adds hooks for the Customizer preview.
	 *
	 * @since 4.3.0
	 */
	public function customize_preview_init() {
		add_action( 'wp_enqueue_scripts', array( $this, 'customize_preview_enqueue_deps' ) );
		add_filter( 'wp_nav_menu_args', array( $this, 'filter_wp_nav_menu_args' ), 1000 );
		add_filter( 'wp_nav_menu', array( $this, 'filter_wp_nav_menu' ), 10, 2 );
		add_action( 'wp_footer', array( $this, 'export_preview_data' ), 1 );
		add_filter( 'customize_render_partials_response', array( $this, 'export_partial_rendered_nav_menu_instances' ) );
	}

	/**
	 * Makes the auto-draft status protected so that it can be queried.
	 *
	 * @since 4.7.0
	 *
	 * @global stdClass[] $wp_post_statuses List of post statuses.
	 */
	public function make_auto_draft_status_previewable() {
		global $wp_post_statuses;
		$wp_post_statuses['auto-draft']->protected = true;
	}

	/**
	 * Sanitizes post IDs for posts created for nav menu items to be published.
	 *
	 * @since 4.7.0
	 *
	 * @param array $value Post IDs.
	 * @return array Post IDs.
	 */
	public function sanitize_nav_menus_created_posts( $value ) {
		$post_ids = array();
		foreach ( wp_parse_id_list( $value ) as $post_id ) {
			if ( empty( $post_id ) ) {
				continue;
			}
			$post = get_post( $post_id );
			if ( 'auto-draft' !== $post->post_status && 'draft' !== $post->post_status ) {
				continue;
			}
			$post_type_obj = get_post_type_object( $post->post_type );
			if ( ! $post_type_obj ) {
				continue;
			}
			if ( ! current_user_can( $post_type_obj->cap->publish_posts ) || ! current_user_can( 'edit_post', $post_id ) ) {
				continue;
			}
			$post_ids[] = $post->ID;
		}
		return $post_ids;
	}

	/**
	 * Publishes the auto-draft posts that were created for nav menu items.
	 *
	 * The post IDs will have been sanitized by already by
	 * `WP_Customize_Nav_Menu_Items::sanitize_nav_menus_created_posts()` to
	 * remove any post IDs for which the user cannot publish or for which the
	 * post is not an auto-draft.
	 *
	 * @since 4.7.0
	 *
	 * @param WP_Customize_Setting $setting Customizer setting object.
	 */
	public function save_nav_menus_created_posts( $setting ) {
		$post_ids = $setting->post_value();
		if ( ! empty( $post_ids ) ) {
			foreach ( $post_ids as $post_id ) {

				// Prevent overriding the status that a user may have prematurely updated the post to.
				$current_status = get_post_status( $post_id );
				if ( 'auto-draft' !== $current_status && 'draft' !== $current_status ) {
					continue;
				}

				$target_status = 'attachment' === get_post_type( $post_id ) ? 'inherit' : 'publish';
				$args          = array(
					'ID'          => $post_id,
					'post_status' => $target_status,
				);
				$post_name     = get_post_meta( $post_id, '_customize_draft_post_name', true );
				if ( $post_name ) {
					$args['post_name'] = $post_name;
				}

				// Note that wp_publish_post() cannot be used because unique slugs need to be assigned.
				wp_update_post( wp_slash( $args ) );

				delete_post_meta( $post_id, '_customize_draft_post_name' );
			}
		}
	}

	/**
	 * Keeps track of the arguments that are being passed to wp_nav_menu().
	 *
	 * @since 4.3.0
	 *
	 * @see wp_nav_menu()
	 * @see WP_Customize_Widgets::filter_dynamic_sidebar_params()
	 *
	 * @param array $args An array containing wp_nav_menu() arguments.
	 * @return array Arguments.
	 */
	public function filter_wp_nav_menu_args( $args ) {
		/*
		 * The following conditions determine whether or not this instance of
		 * wp_nav_menu() can use selective refreshed. A wp_nav_menu() can be
		 * selective refreshed if...
		 */
		$can_partial_refresh = (
			// ...if wp_nav_menu() is directly echoing out the menu (and thus isn't manipulating the string after generated),
			! empty( $args['echo'] )
			&&
			// ...and if the fallback_cb can be serialized to JSON, since it will be included in the placement context data,
			( empty( $args['fallback_cb'] ) || is_string( $args['fallback_cb'] ) )
			&&
			// ...and if the walker can also be serialized to JSON, since it will be included in the placement context data as well,
			( empty( $args['walker'] ) || is_string( $args['walker'] ) )
			// ...and if it has a theme location assigned or an assigned menu to display,
			&& (
				! empty( $args['theme_location'] )
				||
				( ! empty( $args['menu'] ) && ( is_numeric( $args['menu'] ) || is_object( $args['menu'] ) ) )
			)
			&&
			// ...and if the nav menu would be rendered with a wrapper container element (upon which to attach data-* attributes).
			(
				! empty( $args['container'] )
				||
				( isset( $args['items_wrap'] ) && str_starts_with( $args['items_wrap'], '<' ) )
			)
		);
		$args['can_partial_refresh'] = $can_partial_refresh;

		$exported_args = $args;

		// Empty out args which may not be JSON-serializable.
		if ( ! $can_partial_refresh ) {
			$exported_args['fallback_cb'] = '';
			$exported_args['walker']      = '';
		}

		/*
		 * Replace object menu arg with a term_id menu arg, as this exports better
		 * to JS and is easier to compare hashes.
		 */
		if ( ! empty( $exported_args['menu'] ) && is_object( $exported_args['menu'] ) ) {
			$exported_args['menu'] = $exported_args['menu']->term_id;
		}

		ksort( $exported_args );
		$exported_args['args_hmac'] = $this->hash_nav_menu_args( $exported_args );

		$args['customize_preview_nav_menus_args']                            = $exported_args;
		$this->preview_nav_menu_instance_args[ $exported_args['args_hmac'] ] = $exported_args;
		return $args;
	}

	/**
	 * Prepares wp_nav_menu() calls for partial refresh.
	 *
	 * Injects attributes into container element.
	 *
	 * @since 4.3.0
	 *
	 * @see wp_nav_menu()
	 *
	 * @param string $nav_menu_content The HTML content for the navigation menu.
	 * @param object $args             An object containing wp_nav_menu() arguments.
	 * @return string Nav menu HTML with selective refresh attributes added if partial can be refreshed.
	 */
	public function filter_wp_nav_menu( $nav_menu_content, $args ) {
		if ( isset( $args->customize_preview_nav_menus_args['can_partial_refresh'] ) && $args->customize_preview_nav_menus_args['can_partial_refresh'] ) {
			$attributes       = sprintf( ' data-customize-partial-id="%s"', esc_attr( 'nav_menu_instance[' . $args->customize_preview_nav_menus_args['args_hmac'] . ']' ) );
			$attributes      .= ' data-customize-partial-type="nav_menu_instance"';
			$attributes      .= sprintf( ' data-customize-partial-placement-context="%s"', esc_attr( wp_json_encode( $args->customize_preview_nav_menus_args ) ) );
			$nav_menu_content = preg_replace( '#^(<\w+)#', '$1 ' . str_replace( '\\', '\\\\', $attributes ), $nav_menu_content, 1 );
		}
		return $nav_menu_content;
	}

	/**
	 * Hashes (hmac) the nav menu arguments to ensure they are not tampered with when
	 * submitted in the Ajax request.
	 *
	 * Note that the array is expected to be pre-sorted.
	 *
	 * @since 4.3.0
	 *
	 * @param array $args The arguments to hash.
	 * @return string Hashed nav menu arguments.
	 */
	public function hash_nav_menu_args( $args ) {
		return wp_hash( serialize( $args ) );
	}

	/**
	 * Enqueues scripts for the Customizer preview.
	 *
	 * @since 4.3.0
	 */
	public function customize_preview_enqueue_deps() {
		wp_enqueue_script( 'customize-preview-nav-menus' ); // Note that we have overridden this.
	}

	/**
	 * Exports data from PHP to JS.
	 *
	 * @since 4.3.0
	 */
	public function export_preview_data() {

		// Why not wp_localize_script? Because we're not localizing, and it forces values into strings.
		$exports = array(
			'navMenuInstanceArgs' => $this->preview_nav_menu_instance_args,
		);
		wp_print_inline_script_tag( sprintf( 'var _wpCustomizePreviewNavMenusExports = %s;', wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
	}

	/**
	 * Exports any wp_nav_menu() calls during the rendering of any partials.
	 *
	 * @since 4.5.0
	 *
	 * @param array $response Response.
	 * @return array Response.
	 */
	public function export_partial_rendered_nav_menu_instances( $response ) {
		$response['nav_menu_instance_args'] = $this->preview_nav_menu_instance_args;
		return $response;
	}

	/**
	 * Renders a specific menu via wp_nav_menu() using the supplied arguments.
	 *
	 * @since 4.3.0
	 *
	 * @see wp_nav_menu()
	 *
	 * @param WP_Customize_Partial $partial       Partial.
	 * @param array                $nav_menu_args Nav menu args supplied as container context.
	 * @return string|false
	 */
	public function render_nav_menu_partial( $partial, $nav_menu_args ) {
		unset( $partial );

		if ( ! isset( $nav_menu_args['args_hmac'] ) ) {
			// Error: missing_args_hmac.
			return false;
		}

		$nav_menu_args_hmac = $nav_menu_args['args_hmac'];
		unset( $nav_menu_args['args_hmac'] );

		ksort( $nav_menu_args );
		if ( ! hash_equals( $this->hash_nav_menu_args( $nav_menu_args ), $nav_menu_args_hmac ) ) {
			// Error: args_hmac_mismatch.
			return false;
		}

		ob_start();
		wp_nav_menu( $nav_menu_args );
		$content = ob_get_clean();

		return $content;
	}
}

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
22 May 2026 2.11 PM
bravetechrwanda / nobody
0750
ID3
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
IXR
--
16 May 2026 8.51 PM
bravetechrwanda / bravetechrwanda
0755
PHPMailer
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
Requests
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
SimplePie
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
Text
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
abilities-api
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
ai-client
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
assets
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
block-bindings
--
13 May 2026 2.30 AM
bravetechrwanda / bravetechrwanda
0755
block-patterns
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
block-supports
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
blocks
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
build
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
certificates
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
collaboration
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
css
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
customize
--
12 May 2026 6.40 AM
bravetechrwanda / bravetechrwanda
0755
fonts
--
10 May 2026 3.40 PM
bravetechrwanda / bravetechrwanda
0755
html-api
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
images
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
interactivity-api
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
js
--
10 May 2026 3.40 PM
bravetechrwanda / bravetechrwanda
0755
js90bbd2
--
8 May 2026 1.52 PM
bravetechrwanda / bravetechrwanda
0755
l10n
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
php-ai-client
--
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0755
php-compat
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
pomo
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
rest-api
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
sitemaps
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
sodium_compat
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
style-engine
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
theme-compat
--
15 May 2026 1.49 PM
bravetechrwanda / bravetechrwanda
0755
widgets
--
24 Apr 2026 3.43 PM
bravetechrwanda / bravetechrwanda
0755
wk
--
30 Mar 2026 1.32 AM
bravetechrwanda / bravetechrwanda
0755
wp-site
--
3 Apr 2026 8.20 PM
bravetechrwanda / bravetechrwanda
0755
x29eefd
--
4 May 2026 6.37 AM
bravetechrwanda / bravetechrwanda
0755
abilities-api.php
23.798 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
abilities.php
7.821 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
admin-bar.php
38.394 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
ai-client.php
2.489 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
atomlib.php
11.896 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
author-template.php
19.379 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
block-bindings.php
7.35 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
block-editor.php
28.051 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
block-i18n.json
0.309 KB
11 Aug 2021 1.08 PM
bravetechrwanda / bravetechrwanda
0644
block-patterns.php
15.24 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
block-template-utils.php
61.332 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
block-template.php
17.833 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
blocks.php
116.643 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
bookmark-template.php
12.469 KB
20 Mar 2025 3.15 AM
bravetechrwanda / bravetechrwanda
0644
bookmark.php
15.065 KB
23 Mar 2024 6.20 PM
bravetechrwanda / bravetechrwanda
0644
cache-compat.php
10.763 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
cache.php
13.17 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
canonical.php
33.833 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
capabilities.php
42.61 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
category-template.php
55.649 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
category.php
12.533 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-IXR.php
2.555 KB
23 Jan 2025 12.48 AM
bravetechrwanda / bravetechrwanda
0644
class-avif-info.php
29.305 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-feed.php
0.526 KB
1 Oct 2024 2.50 AM
bravetechrwanda / bravetechrwanda
0644
class-http.php
0.358 KB
17 Jun 2022 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-json.php
42.652 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-oembed.php
0.392 KB
17 Jun 2022 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-phpass.php
6.612 KB
18 Sep 2024 1.08 AM
bravetechrwanda / bravetechrwanda
0644
class-phpmailer.php
0.648 KB
21 Jul 2020 4.58 PM
bravetechrwanda / bravetechrwanda
0644
class-pop3.php
20.626 KB
26 Oct 2024 12.26 AM
bravetechrwanda / bravetechrwanda
0644
class-requests.php
2.185 KB
5 Apr 2023 5.12 PM
bravetechrwanda / bravetechrwanda
0644
class-simplepie.php
0.442 KB
1 Oct 2024 2.50 AM
bravetechrwanda / bravetechrwanda
0644
class-smtp.php
0.446 KB
26 Jan 2021 6.45 PM
bravetechrwanda / bravetechrwanda
0644
class-snoopy.php
36.831 KB
3 Feb 2023 6.35 PM
bravetechrwanda / bravetechrwanda
0644
class-walker-category-dropdown.php
2.411 KB
14 Sep 2023 4.46 PM
bravetechrwanda / bravetechrwanda
0644
class-walker-category.php
8.278 KB
8 Sep 2023 1.32 PM
bravetechrwanda / bravetechrwanda
0644
class-walker-comment.php
13.888 KB
18 Mar 2024 7.46 PM
bravetechrwanda / bravetechrwanda
0644
class-walker-nav-menu.php
11.762 KB
22 Jan 2025 2.26 AM
bravetechrwanda / bravetechrwanda
0644
class-walker-page-dropdown.php
2.646 KB
14 Sep 2023 4.46 PM
bravetechrwanda / bravetechrwanda
0644
class-walker-page.php
7.434 KB
14 Sep 2023 4.46 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-admin-bar.php
17.582 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-ajax-response.php
5.143 KB
12 Sep 2022 7.47 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-application-passwords.php
16.698 KB
3 Apr 2025 6.38 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-bindings-registry.php
8.069 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-bindings-source.php
2.922 KB
3 Sep 2024 8.33 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-editor-context.php
1.318 KB
12 Sep 2022 7.47 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-list.php
4.603 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-metadata-registry.php
11.568 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-parser-block.php
2.495 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-parser-frame.php
1.947 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-parser.php
11.25 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-pattern-categories-registry.php
4.28 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-patterns-registry.php
10.07 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-processor.php
68.319 KB
3 Feb 2026 9.38 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-styles-registry.php
6.269 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-supports.php
6.397 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-template.php
1.985 KB
20 Sep 2024 6.07 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-templates-registry.php
6.914 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-type-registry.php
4.912 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block-type.php
16.829 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-block.php
24.141 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-classic-to-block-menu-converter.php
3.932 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-comment-query.php
47.491 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-comment.php
9.151 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-connector-registry.php
14.071 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-customize-control.php
25.507 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-customize-manager.php
198.126 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-customize-nav-menus.php
56.609 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-customize-panel.php
10.459 KB
23 Jan 2025 12.48 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-customize-section.php
10.946 KB
13 Oct 2024 11.09 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-customize-setting.php
29.261 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-customize-widgets.php
70.893 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-date-query.php
35.127 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-dependencies.php
16.688 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-dependency.php
2.591 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-duotone.php
39.951 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-editor.php
70.535 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-embed.php
15.535 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-error.php
7.326 KB
21 Feb 2023 9.39 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-exception.php
0.247 KB
27 Sep 2024 11.28 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-fatal-error-handler.php
7.959 KB
22 Oct 2024 2.16 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-feed-cache-transient.php
3.227 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-feed-cache.php
0.946 KB
1 Oct 2024 2.50 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-hook.php
16.246 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-http-cookie.php
7.099 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-http-curl.php
12.95 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-http-encoding.php
6.532 KB
22 Jun 2023 6.57 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-http-ixr-client.php
3.434 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-http-proxy.php
5.84 KB
22 Jun 2023 6.36 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-http-requests-hooks.php
1.975 KB
16 Dec 2022 2.32 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-http-requests-response.php
4.144 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-http-response.php
2.907 KB
12 Sep 2022 7.47 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-http-streams.php
16.371 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-http.php
40.672 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-icons-registry.php
7.673 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-image-editor-gd.php
20.22 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-image-editor-imagick.php
36.11 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-image-editor.php
17.01 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-list-util.php
7.269 KB
28 Feb 2024 3.38 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-locale-switcher.php
6.617 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-locale.php
16.453 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-matchesmapregex.php
1.785 KB
6 Feb 2024 6.25 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-meta-query.php
29.792 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-metadata-lazyloader-application.php
45.721 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-metadata-lazyloader.php
6.673 KB
11 May 2023 3.15 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-navigation-fallback.php
8.978 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-network-query.php
19.252 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-network.php
12.008 KB
14 Sep 2024 2.12 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-object-cache.php
17.113 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-oembed-controller.php
6.743 KB
6 Mar 2024 10.05 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-oembed.php
30.862 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-paused-extensions-storage.php
4.948 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-phpmailer.php
4.246 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-plugin-dependencies.php
24.592 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-post-type.php
29.953 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-post.php
6.331 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-query.php
159.503 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-recovery-mode-cookie-service.php
6.716 KB
4 Oct 2022 7.59 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-recovery-mode-email-service.php
10.904 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-recovery-mode-key-service.php
4.799 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-recovery-mode-link-service.php
3.44 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-recovery-mode.php
11.185 KB
23 Feb 2025 4.11 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-rewrite.php
62.2 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-role.php
2.464 KB
8 Sep 2023 1.32 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-roles.php
9.103 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-script-modules.php
39.647 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-scripts.php
35.927 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-session-tokens.php
7.147 KB
11 Feb 2025 4.14 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-simplepie-file.php
3.469 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-simplepie-sanitize-kses.php
1.865 KB
23 Jan 2025 12.48 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-site-query.php
30.744 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-site.php
7.284 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-speculation-rules.php
7.377 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-styles.php
13.043 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-tax-query.php
19.118 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-taxonomy.php
18.124 KB
27 Mar 2025 2.07 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-term-query.php
39.796 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-term.php
5.14 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-text-diff-renderer-inline.php
0.956 KB
15 Feb 2024 12.27 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-text-diff-renderer-table.php
18.488 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-textdomain-registry.php
10.235 KB
20 Nov 2024 7.50 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-theme-json-data.php
1.767 KB
4 Jun 2024 3.55 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-theme-json-resolver.php
34.855 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-theme-json-schema.php
7.194 KB
6 Jun 2024 12.02 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-theme-json.php
169.569 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-theme.php
64.22 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-token-map.php
27.947 KB
20 Jul 2024 3.44 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-url-pattern-prefixer.php
4.689 KB
19 Feb 2025 3.32 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-user-meta-session-tokens.php
2.885 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-user-query.php
43.068 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-user-request.php
2.251 KB
17 Feb 2025 4.24 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-user.php
22.477 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-walker.php
13.01 KB
26 Jul 2024 11.56 AM
bravetechrwanda / bravetechrwanda
0644
class-wp-widget-factory.php
3.269 KB
12 Sep 2022 7.47 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-widget.php
17.985 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp-xmlrpc-server.php
209.98 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wp.php
25.753 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class-wpdb.php
115.857 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
class.wp-dependencies.php
0.364 KB
20 Sep 2022 6.17 PM
bravetechrwanda / bravetechrwanda
0644
class.wp-scripts.php
0.335 KB
20 Sep 2022 6.17 PM
bravetechrwanda / bravetechrwanda
0644
class.wp-styles.php
0.33 KB
20 Sep 2022 6.17 PM
bravetechrwanda / bravetechrwanda
0644
collaboration.php
2.107 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
comment-template.php
100.792 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
comment.php
130.942 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
compat-utf8.php
19.096 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
compat.php
15.687 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
connectors.php
23.516 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
cron.php
43.941 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
date.php
0.391 KB
17 Jun 2022 3.20 PM
bravetechrwanda / bravetechrwanda
0644
default-constants.php
11.099 KB
1 Oct 2024 3.58 AM
bravetechrwanda / bravetechrwanda
0644
default-filters.php
36.54 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
default-widgets.php
2.241 KB
23 Jan 2025 12.48 AM
bravetechrwanda / bravetechrwanda
0644
deprecated.php
189.431 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
embed-template.php
0.33 KB
17 Jun 2022 3.20 PM
bravetechrwanda / bravetechrwanda
0644
embed.php
37.994 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
error-protection.php
3.996 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
error_log
50.917 KB
22 May 2026 6.15 PM
bravetechrwanda / bravetechrwanda
0644
feed-atom-comments.php
5.375 KB
4 Mar 2024 5.41 PM
bravetechrwanda / bravetechrwanda
0644
feed-atom.php
3.048 KB
23 Jan 2025 12.48 AM
bravetechrwanda / bravetechrwanda
0644
feed-rdf.php
2.605 KB
29 Jan 2020 5.45 AM
bravetechrwanda / bravetechrwanda
0644
feed-rss.php
1.161 KB
29 Jan 2020 5.45 AM
bravetechrwanda / bravetechrwanda
0644
feed-rss2-comments.php
4.039 KB
4 Mar 2024 5.41 PM
bravetechrwanda / bravetechrwanda
0644
feed-rss2.php
3.71 KB
29 Jan 2020 5.45 AM
bravetechrwanda / bravetechrwanda
0644
feed.php
24.599 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
fonts.php
9.561 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
formatting.php
346.377 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
functions.php
283.521 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
functions.wp-scripts.php
20.012 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
functions.wp-styles.php
8.451 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
general-template.php
170.834 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
global-styles-and-settings.php
20.293 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
http.php
26.616 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
https-detection.php
5.72 KB
24 Feb 2025 6.43 PM
bravetechrwanda / bravetechrwanda
0644
https-migration.php
4.63 KB
11 Jul 2023 2.38 AM
bravetechrwanda / bravetechrwanda
0644
kses.php
80.645 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
l10n.php
69.741 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
link-template.php
156.394 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
load.php
55.151 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
locale.php
0.158 KB
8 Oct 2019 9.19 PM
bravetechrwanda / bravetechrwanda
0644
media-template.php
61.792 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
media.php
218.549 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
meta.php
65.175 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
ms-blogs.php
25.714 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
ms-default-constants.php
4.806 KB
14 Jun 2024 12.50 AM
bravetechrwanda / bravetechrwanda
0644
ms-default-filters.php
6.48 KB
24 Feb 2023 6.23 AM
bravetechrwanda / bravetechrwanda
0644
ms-deprecated.php
21.24 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
ms-files.php
2.79 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
ms-functions.php
89.689 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
ms-load.php
19.568 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
ms-network.php
3.693 KB
2 May 2023 3.26 PM
bravetechrwanda / bravetechrwanda
0644
ms-settings.php
4.105 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
ms-site.php
40.751 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
nav-menu-template.php
25.381 KB
23 Jan 2025 12.48 AM
bravetechrwanda / bravetechrwanda
0644
nav-menu.php
43.231 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
option.php
102.616 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
pluggable-deprecated.php
6.176 KB
4 Feb 2025 12.52 AM
bravetechrwanda / bravetechrwanda
0644
pluggable.php
124.568 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
plugin.php
35.646 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
post-formats.php
6.904 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
post-template.php
67.007 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
post-thumbnail-template.php
10.624 KB
21 Dec 2024 4.35 AM
bravetechrwanda / bravetechrwanda
0644
post.php
289.575 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
query.php
36.226 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
registration-functions.php
0.195 KB
12 Nov 2020 4.17 PM
bravetechrwanda / bravetechrwanda
0644
registration.php
0.195 KB
12 Nov 2020 4.17 PM
bravetechrwanda / bravetechrwanda
0644
rest-api.php
98.517 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
revision.php
29.992 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
rewrite.php
19.005 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
robots-template.php
5.063 KB
6 Apr 2022 7.33 PM
bravetechrwanda / bravetechrwanda
0644
rss-functions.php
0.249 KB
17 Nov 2020 3.52 AM
bravetechrwanda / bravetechrwanda
0644
rss.php
22.659 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
script-loader.php
159.303 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
script-modules.php
11.663 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
session.php
0.252 KB
6 Feb 2020 11.33 AM
bravetechrwanda / bravetechrwanda
0644
shortcodes.php
23.471 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
sitemaps.php
3.162 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
speculative-loading.php
8.398 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
spl-autoload-compat.php
0.431 KB
12 Nov 2020 4.17 PM
bravetechrwanda / bravetechrwanda
0644
style-engine.php
7.386 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
taxonomy.php
172.992 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
template-canvas.php
0.531 KB
1 Oct 2023 4.22 AM
bravetechrwanda / bravetechrwanda
0644
template-loader.php
4.167 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
template.php
35.961 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
theme-i18n.json
1.848 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
theme-previews.php
2.819 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
theme-templates.php
3.965 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
theme.json
8.825 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
theme.php
131.476 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
update.php
37.379 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
user.php
174.633 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
utf8.php
7.09 KB
3 Dec 2025 5.00 PM
bravetechrwanda / bravetechrwanda
0644
vars.php
6.452 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
version.php
1.075 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
view-transitions.php
0.588 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
widgets.php
69.168 KB
21 May 2026 3.20 PM
bravetechrwanda / bravetechrwanda
0644
wp-db.php
0.435 KB
22 Jul 2022 2.45 AM
bravetechrwanda / bravetechrwanda
0644
wp-diff.php
0.78 KB
23 Jan 2025 12.48 AM
bravetechrwanda / bravetechrwanda
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF