wp/wp-includes/widgets/class-wp-nav-menu-widget.php
changeset 21 48c4eec2b7e6
parent 18 be944660c56a
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
   135 	/**
   135 	/**
   136 	 * Outputs the settings form for the Navigation Menu widget.
   136 	 * Outputs the settings form for the Navigation Menu widget.
   137 	 *
   137 	 *
   138 	 * @since 3.0.0
   138 	 * @since 3.0.0
   139 	 *
   139 	 *
       
   140 	 * @global WP_Customize_Manager $wp_customize
       
   141 	 *
   140 	 * @param array $instance Current settings.
   142 	 * @param array $instance Current settings.
   141 	 * @global WP_Customize_Manager $wp_customize
       
   142 	 */
   143 	 */
   143 	public function form( $instance ) {
   144 	public function form( $instance ) {
   144 		global $wp_customize;
   145 		global $wp_customize;
   145 		$title    = isset( $instance['title'] ) ? $instance['title'] : '';
   146 		$title    = isset( $instance['title'] ) ? $instance['title'] : '';
   146 		$nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
   147 		$nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
   169 				$url = 'javascript: wp.customize.panel( "nav_menus" ).focus();';
   170 				$url = 'javascript: wp.customize.panel( "nav_menus" ).focus();';
   170 			} else {
   171 			} else {
   171 				$url = admin_url( 'nav-menus.php' );
   172 				$url = admin_url( 'nav-menus.php' );
   172 			}
   173 			}
   173 
   174 
   174 			/* translators: %s: URL to create a new menu. */
   175 			printf(
   175 			printf( __( 'No menus have been created yet. <a href="%s">Create some</a>.' ), esc_attr( $url ) );
   176 				/* translators: %s: URL to create a new menu. */
       
   177 				__( 'No menus have been created yet. <a href="%s">Create some</a>.' ),
       
   178 				// The URL can be a `javascript:` link, so esc_attr() is used here instead of esc_url().
       
   179 				esc_attr( $url )
       
   180 			);
   176 			?>
   181 			?>
   177 		</p>
   182 		</p>
   178 		<div class="nav-menu-widget-form-controls" <?php echo $empty_menus_style; ?>>
   183 		<div class="nav-menu-widget-form-controls" <?php echo $empty_menus_style; ?>>
   179 			<p>
   184 			<p>
   180 				<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
   185 				<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>