get_site_screen_help_tab_args()
云策文档标注
概述
get_site_screen_help_tab_args() 函数用于返回编辑站点屏幕中帮助标签的参数数组,包含概述、用户、主题和设置等部分的内容。
关键要点
- 函数返回一个数组,包含帮助标签的 id、title 和 content 参数。
- content 部分使用 __() 函数进行国际化翻译,涵盖站点信息、用户管理、主题启用和设置说明。
- 函数在 WordPress 4.9.0 版本中引入,适用于网络管理员编辑单个站点信息。
代码示例
function get_site_screen_help_tab_args() {
return array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'' . __( 'The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.' ) . '' .
'' . __( 'Info — The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.' ) . '' .
'' . __( 'Users — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.' ) . '' .
'' . sprintf(
/* translators: %s: URL to Network Themes screen. */
__( 'Themes — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the Network Themes screen.' ),
network_admin_url( 'themes.php' )
) . '' .
'' . __( 'Settings — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.' ) . '',
);
}
原文内容
Returns the arguments for the help tab on the Edit Site screens.
Source
function get_site_screen_help_tab_args() {
return array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.' ) . '</p>' .
'<p>' . __( '<strong>Info</strong> — The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.' ) . '</p>' .
'<p>' . __( '<strong>Users</strong> — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.' ) . '</p>' .
'<p>' . sprintf(
/* translators: %s: URL to Network Themes screen. */
__( '<strong>Themes</strong> — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ),
network_admin_url( 'themes.php' )
) . '</p>' .
'<p>' . __( '<strong>Settings</strong> — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.' ) . '</p>',
);
}
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |