钩子文档

screen_options_show_screen

💡 云策文档标注

概述

screen_options_show_screen 是一个 WordPress 过滤器,用于控制是否显示屏幕选项标签。它允许开发者根据条件动态调整显示状态。

关键要点

  • 这是一个过滤器钩子,用于修改屏幕选项标签的显示行为。
  • 接受两个参数:$show_screen(布尔值,默认 true)和 $screen(WP_Screen 实例)。
  • 在 WP_Screen::show_screen_options() 方法中调用,位于 wp-admin/includes/class-wp-screen.php 文件。
  • 自 WordPress 3.2.0 版本引入。

📄 原文内容

Filters whether to show the Screen Options tab.

Parameters

$show_screenbool
Whether to show Screen Options tab.
Default true.
$screenWP_Screen
Current WP_Screen instance.

Source

$this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );

Changelog

Version Description
3.2.0 Introduced.