wp/wp-includes/customize/class-wp-customize-nav-menus-panel.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    67 	 */
    67 	 */
    68 	protected function content_template() {
    68 	protected function content_template() {
    69 		?>
    69 		?>
    70 		<li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>">
    70 		<li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>">
    71 			<button type="button" class="customize-panel-back" tabindex="-1">
    71 			<button type="button" class="customize-panel-back" tabindex="-1">
    72 				<span class="screen-reader-text"><?php _e( 'Back' ); ?></span>
    72 				<span class="screen-reader-text">
       
    73 					<?php
       
    74 					/* translators: Hidden accessibility text. */
       
    75 					_e( 'Back' );
       
    76 					?>
       
    77 				</span>
    73 			</button>
    78 			</button>
    74 			<div class="accordion-section-title">
    79 			<div class="accordion-section-title">
    75 				<span class="preview-notice">
    80 				<span class="preview-notice">
    76 					<?php
    81 					<?php
    77 					/* translators: %s: The site/panel title in the Customizer. */
    82 					/* translators: %s: The site/panel title in the Customizer. */
    78 					printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
    83 					printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
    79 					?>
    84 					?>
    80 				</span>
    85 				</span>
    81 				<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false">
    86 				<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false">
    82 					<span class="screen-reader-text"><?php _e( 'Help' ); ?></span>
    87 					<span class="screen-reader-text">
       
    88 						<?php
       
    89 						/* translators: Hidden accessibility text. */
       
    90 						_e( 'Help' );
       
    91 						?>
       
    92 					</span>
    83 				</button>
    93 				</button>
    84 				<button type="button" class="customize-screen-options-toggle" aria-expanded="false">
    94 				<button type="button" class="customize-screen-options-toggle" aria-expanded="false">
    85 					<span class="screen-reader-text"><?php _e( 'Menu Options' ); ?></span>
    95 					<span class="screen-reader-text">
       
    96 						<?php
       
    97 						/* translators: Hidden accessibility text. */
       
    98 						_e( 'Menu Options' );
       
    99 						?>
       
   100 					</span>
    86 				</button>
   101 				</button>
    87 			</div>
   102 			</div>
    88 			<# if ( data.description ) { #>
   103 			<# if ( data.description ) { #>
    89 			<div class="description customize-panel-description">{{{ data.description }}}</div>
   104 			<div class="description customize-panel-description">{{{ data.description }}}</div>
    90 			<# } #>
   105 			<# } #>
    96 		// NOTE: The following is a workaround for an inability to treat (and thus label) a list of sections as a whole.
   111 		// NOTE: The following is a workaround for an inability to treat (and thus label) a list of sections as a whole.
    97 		?>
   112 		?>
    98 		<li class="customize-control-title customize-section-title-nav_menus-heading"><?php _e( 'Menus' ); ?></li>
   113 		<li class="customize-control-title customize-section-title-nav_menus-heading"><?php _e( 'Menus' ); ?></li>
    99 		<?php
   114 		<?php
   100 	}
   115 	}
   101 
       
   102 	/**
       
   103 	 * Checks required user capabilities and whether the theme has the
       
   104 	 * feature support required by the panel.
       
   105 	 *
       
   106 	 * @since 5.9.0
       
   107 	 *
       
   108 	 * @return bool False if theme doesn't support the panel or the user doesn't have the capability.
       
   109 	 */
       
   110 	public function check_capabilities() {
       
   111 		/*
       
   112 		 * WP_Customize_Panel::$theme_supports only supports checking one
       
   113 		 * theme_supports, so instead we override check_capabilities().
       
   114 		 */
       
   115 		if (
       
   116 			! current_theme_supports( 'menus' ) &&
       
   117 			! current_theme_supports( 'widgets' )
       
   118 		) {
       
   119 			return false;
       
   120 		}
       
   121 
       
   122 		return parent::check_capabilities();
       
   123 	}
       
   124 }
   116 }