[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/customize/ -> class-wp-customize-nav-menu-control.php (source)

   1  <?php
   2  /**
   3   * Customize API: WP_Customize_Nav_Menu_Control class
   4   *
   5   * @package WordPress
   6   * @subpackage Customize
   7   * @since 4.4.0
   8   */
   9  
  10  /**
  11   * Customize Nav Menu Control Class.
  12   *
  13   * @since 4.3.0
  14   *
  15   * @see WP_Customize_Control
  16   */
  17  class WP_Customize_Nav_Menu_Control extends WP_Customize_Control {
  18  
  19      /**
  20       * Control type.
  21       *
  22       * @since 4.3.0
  23       * @var string
  24       */
  25      public $type = 'nav_menu';
  26  
  27      /**
  28       * Don't render the control's content - it uses a JS template instead.
  29       *
  30       * @since 4.3.0
  31       */
  32  	public function render_content() {}
  33  
  34      /**
  35       * JS/Underscore template for the control UI.
  36       *
  37       * @since 4.3.0
  38       */
  39  	public function content_template() {
  40          $add_items = __( 'Add Items' );
  41          ?>
  42          <p class="new-menu-item-invitation">
  43              <?php
  44              printf(
  45                  /* translators: %s: "Add Items" button text. */
  46                  __( 'Time to add some links! Click &#8220;%s&#8221; to start putting pages, categories, and custom links in your menu. Add as many things as you would like.' ),
  47                  $add_items
  48              );
  49              ?>
  50          </p>
  51          <div class="customize-control-nav_menu-buttons">
  52              <button type="button" class="button add-new-menu-item" aria-label="<?php esc_attr_e( 'Add or remove menu items' ); ?>" aria-expanded="false" aria-controls="available-menu-items">
  53                  <?php echo $add_items; ?>
  54              </button>
  55              <button type="button" class="button-link reorder-toggle" aria-label="<?php esc_attr_e( 'Reorder menu items' ); ?>" aria-describedby="reorder-items-desc-{{ data.menu_id }}">
  56                  <span class="reorder"><?php _e( 'Reorder' ); ?></span>
  57                  <span class="reorder-done"><?php _e( 'Done' ); ?></span>
  58              </button>
  59          </div>
  60          <p class="screen-reader-text" id="reorder-items-desc-{{ data.menu_id }}">
  61              <?php
  62              /* translators: Hidden accessibility text. */
  63              _e( 'When in reorder mode, additional controls to reorder menu items will be available in the items list above.' );
  64              ?>
  65          </p>
  66          <?php
  67      }
  68  
  69      /**
  70       * Return parameters for this control.
  71       *
  72       * @since 4.3.0
  73       *
  74       * @return array Exported parameters.
  75       */
  76  	public function json() {
  77          $exported            = parent::json();
  78          $exported['menu_id'] = $this->setting->term_id;
  79  
  80          return $exported;
  81      }
  82  }


Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref