钩子文档

screen_layout_columns

💡 云策文档标注

概述

screen_layout_columns 是一个 WordPress 过滤器钩子,用于修改屏幕布局列数组。它主要用于向后兼容插件,这些插件使用旧式过滤器而非 add_screen_option() 方法。

关键要点

  • 这是一个过滤器钩子,允许开发者调整屏幕布局列数组。
  • 主要用途是向后兼容,支持使用旧式过滤器的插件。
  • 参数包括空数组、屏幕 ID 和当前 WP_Screen 实例。
  • 在 WP_Screen::render_screen_meta() 方法中使用,用于渲染屏幕帮助部分。
  • 自 WordPress 2.8.0 版本引入。

代码示例

$columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );

📄 原文内容

Filters the array of screen layout columns.

Description

This hook provides back-compat for plugins using the back-compat Filters instead of add_screen_option() .

Parameters

$empty_columnsarray
Empty array.
$screen_idstring
Screen ID.
$screenWP_Screen
Current WP_Screen instance.

Source

$columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );

Changelog

Version Description
2.8.0 Introduced.