wp/wp-admin/includes/class-wp-screen.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
   400 	 *
   400 	 *
   401 	 * @see set_current_screen()
   401 	 * @see set_current_screen()
   402 	 * @since 3.3.0
   402 	 * @since 3.3.0
   403 	 *
   403 	 *
   404 	 * @global WP_Screen $current_screen WordPress current screen object.
   404 	 * @global WP_Screen $current_screen WordPress current screen object.
   405 	 * @global string    $taxnow
   405 	 * @global string    $typenow        The post type of the current screen.
   406 	 * @global string    $typenow
   406 	 * @global string    $taxnow         The taxonomy of the current screen.
   407 	 */
   407 	 */
   408 	public function set_current_screen() {
   408 	public function set_current_screen() {
   409 		global $current_screen, $taxnow, $typenow;
   409 		global $current_screen, $taxnow, $typenow;
       
   410 
   410 		$current_screen = $this;
   411 		$current_screen = $this;
       
   412 		$typenow        = $this->post_type;
   411 		$taxnow         = $this->taxonomy;
   413 		$taxnow         = $this->taxonomy;
   412 		$typenow        = $this->post_type;
       
   413 
   414 
   414 		/**
   415 		/**
   415 		 * Fires after the current screen has been set.
   416 		 * Fires after the current screen has been set.
   416 		 *
   417 		 *
   417 		 * @since 3.0.0
   418 		 * @since 3.0.0
  1006 		}
  1007 		}
  1007 
  1008 
  1008 		/**
  1009 		/**
  1009 		 * Filters the screen settings text displayed in the Screen Options tab.
  1010 		 * Filters the screen settings text displayed in the Screen Options tab.
  1010 		 *
  1011 		 *
  1011 		 * This filter is currently only used on the Widgets screen to enable
       
  1012 		 * accessibility mode.
       
  1013 		 *
       
  1014 		 * @since 3.0.0
  1012 		 * @since 3.0.0
  1015 		 *
  1013 		 *
  1016 		 * @param string    $screen_settings Screen settings.
  1014 		 * @param string    $screen_settings Screen settings.
  1017 		 * @param WP_Screen $this            WP_Screen object.
  1015 		 * @param WP_Screen $screen          WP_Screen object.
  1018 		 */
  1016 		 */
  1019 		$this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this );
  1017 		$this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this );
  1020 
  1018 
  1021 		if ( $this->_screen_settings || $this->_options ) {
  1019 		if ( $this->_screen_settings || $this->_options ) {
  1022 			$show_screen = true;
  1020 			$show_screen = true;
  1027 		 *
  1025 		 *
  1028 		 * @since 3.2.0
  1026 		 * @since 3.2.0
  1029 		 *
  1027 		 *
  1030 		 * @param bool      $show_screen Whether to show Screen Options tab.
  1028 		 * @param bool      $show_screen Whether to show Screen Options tab.
  1031 		 *                               Default true.
  1029 		 *                               Default true.
  1032 		 * @param WP_Screen $this        Current WP_Screen instance.
  1030 		 * @param WP_Screen $screen      Current WP_Screen instance.
  1033 		 */
  1031 		 */
  1034 		$this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
  1032 		$this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
  1035 		return $this->_show_screen_options;
  1033 		return $this->_show_screen_options;
  1036 	}
  1034 	}
  1037 
  1035