Skip to content

Instantly share code, notes, and snippets.

@egill

egill/menu-locations.txt Secret

Created Sep 6, 2015
Embed
What would you like to do?
menu locations
wp-admin/css/nav-menus.css: /* menu locations */
wp-admin/includes/ajax-actions.php: * Ajax handler for menu locations save.
wp-admin/includes/nav-menu.php: * Check whether to disable the Menu Locations meta box submit button
wp-admin/js/customize-nav-menus.js: * Customizer control for menu locations (rendered as a <select>).
wp-admin/nav-menus.php:// Get existing menu locations assignments
wp-admin/nav-menus.php: // Remove menu locations that have been unchecked.
wp-admin/nav-menus.php: // Merge new and existing menu locations if any new ones are set.
wp-admin/nav-menus.php: // Set menu locations.
wp-admin/nav-menus.php: // Set menu locations
wp-admin/nav-menus.php: $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Menu locations updated.' ) . '</p></div>';
wp-admin/nav-menus.php:// Retrieve menu locations.
wp-admin/nav-menus.php: * Fires after the menu locations table is displayed.
wp-admin/nav-menus.php: * @param int $locations Number of menu locations to list. Default 3.
wp-includes/class-wp-customize-control.php: <span class="customize-control-title"><?php _e( 'Menu locations' ); ?></span>
wp-includes/class-wp-customize-control.php: <span class="theme-location-set"><?php printf( _x( '(Current: %s)', 'Current menu location' ), '<span class="current-menu-location-name-' . esc_attr( $location ) . '"></span>' ); ?></span>
wp-includes/class-wp-customize-control.php: * Customize Menu Location Control Class.
wp-includes/class-wp-customize-nav-menus.php: /* translators: %s: Current menu location */
wp-includes/class-wp-customize-nav-menus.php: // Menu locations.
wp-includes/class-wp-customize-nav-menus.php: 'title' => __( 'Menu Locations' ),
wp-includes/class-wp-customize-setting.php: // Make sure that new menus assigned to nav menu locations use their new IDs.
wp-includes/js/customize-preview-nav-menus.js: * Refresh the menu(s) associated with a given nav menu location.
wp-includes/nav-menu.php: * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
wp-includes/nav-menu.php: * @param string $location The menu location identifier.
wp-includes/nav-menu.php: * @param string $location Menu location identifier, like a slug.
wp-includes/nav-menu.php: * @param string $description Menu location descriptive text.
wp-includes/nav-menu.php: * Returns an array with the registered navigation menu locations and the menu assigned to it
wp-includes/nav-menu.php: * Whether a registered nav menu location has a menu assigned to it.
wp-includes/nav-menu.php: * @param string $location Menu location identifier.
wp-includes/nav-menu.php: * @param string $location Menu location.
wp-includes/taxonomy-functions.php: // Update menu locations.
wp-admin/admin-ajax.php: 'menu-locations-save', 'menu-quick-search', 'meta-box-order', 'get-permalink',
wp-admin/css/customize-nav-menus.css:li.assigned-to-menu-location .menu-delete-item {
wp-admin/css/customize-nav-menus.css:li.assigned-to-menu-location .add-new-menu-item {
wp-admin/css/list-tables.css:#menu-locations-wrap .widefat {
wp-admin/css/nav-menus.css:.widefat .menu-locations tr + tr td {
wp-admin/css/nav-menus.css:.widefat .menu-locations td {
wp-admin/css/nav-menus.css:.menu-location-title label {
wp-admin/css/nav-menus.css:.menu-location-menus select {
wp-admin/css/nav-menus.css: #menu-locations-wrap .widefat {
wp-admin/includes/ajax-actions.php: if ( ! isset( $_POST['menu-locations'] ) )
wp-admin/includes/ajax-actions.php: set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) );
wp-admin/js/customize-nav-menus.js: section.container.toggleClass( 'assigned-to-menu-location', 0 !== themeLocations.length );
wp-admin/js/customize-nav-menus.js: control.container.find( '.assigned-menu-location' ).each(function() {
wp-admin/js/customize-nav-menus.js: $( '.current-menu-location-name-' + $( this ).data( 'location-id' ) ).text( name );
wp-admin/js/nav-menu.js: $('#menu-locations-wrap form').submit(function(){
wp-admin/js/nav-menu.js: $('.menu-location-menus select').on('change', function () {
wp-admin/js/nav-menu.js: params.action = 'menu-locations-save';
wp-admin/js/nav-menu.js: $('#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select').change(function(){
wp-admin/js/nav-menu.js: if ( 0 !== $('#menu-to-edit').length || 0 !== $('.menu-location-menus select').length ) {
wp-admin/nav-menus.php: if ( isset( $_REQUEST['nav-menu-locations'] ) )
wp-admin/nav-menus.php: set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_REQUEST['menu-locations'] ) );
wp-admin/nav-menus.php: if ( ( empty( $_POST['menu-locations'] ) || empty( $_POST['menu-locations'][ $location ] ) ) && isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id )
wp-admin/nav-menus.php: if ( isset( $_POST['menu-locations'] ) ) {
wp-admin/nav-menus.php: $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] );
wp-admin/nav-menus.php: if ( isset( $_POST['menu-locations'] ) ) {
wp-admin/nav-menus.php: check_admin_referer( 'save-menu-locations' );
wp-admin/nav-menus.php: $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] );
wp-admin/nav-menus.php: <div id="menu-locations-wrap">
wp-admin/nav-menus.php: <table class="widefat fixed" id="menu-locations-table">
wp-admin/nav-menus.php: <tbody class="menu-locations">
wp-admin/nav-menus.php: <tr class="menu-locations-row">
wp-admin/nav-menus.php: <td class="menu-location-title"><label for="locations-<?php echo $_location; ?>"><?php echo $_name; ?></label></td>
wp-admin/nav-menus.php: <td class="menu-location-menus">
wp-admin/nav-menus.php: <select name="menu-locations[<?php echo $_location; ?>]" id="locations-<?php echo $_location; ?>">
wp-admin/nav-menus.php: </td><!-- .menu-location-menus -->
wp-admin/nav-menus.php: </tr><!-- .menu-locations-row -->
wp-admin/nav-menus.php: <p class="button-controls"><?php submit_button( __( 'Save Changes' ), 'primary left', 'nav-menu-locations', false ); ?></p>
wp-admin/nav-menus.php: <?php wp_nonce_field( 'save-menu-locations' ); ?>
wp-admin/nav-menus.php: </div><!-- #menu-locations-wrap -->
wp-admin/nav-menus.php: <input type="checkbox"<?php checked( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id ); ?> name="menu-locations[<?php echo esc_attr( $location ); ?>]" id="locations-<?php echo esc_attr( $location ); ?>" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" /> <label for="locations-<?php echo esc_attr( $location ); ?>"><?php echo $description; ?></label>
wp-includes/class-wp-customize-control.php: <li class="customize-control customize-control-checkbox assigned-menu-location">
wp-includes/class-wp-customize-control.php: <input type="checkbox" data-menu-id="{{ data.menu_id }}" data-location-id="<?php echo esc_attr( $location ); ?>" class="menu-location" /> <?php echo $description; ?>
wp-includes/class-wp-customize-control.php: <span class="theme-location-set"><?php printf( _x( '(Current: %s)', 'Current menu location' ), '<span class="current-menu-location-name-' . esc_attr( $location ) . '"></span>' ); ?></span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment