Questions tagged «contextual-help»

3
定位屏幕(上下文)帮助标签
使用新WP_Screen类可以非常轻松地向屏幕添加帮助文本。 <?php add_action( "load-{$somepage}", 'wpse_load_reading' ); function wpse_load_reading() { get_current_screen()->add_help_tab( array( 'id' => 'my-help-tab', 'title' => __( 'My Title' ), 'content' => __( 'Help Content' ) ) ); } 这对于自定义页面非常有用。但是,假设在现有屏幕上添加帮助标签时options-reading.php,会有些奇怪。 load-options-reading.php在内置WP页面添加其自己的帮助选项卡之前,将触发该挂钩。换句话说,在现有屏幕上添加帮助选项卡会将所有内置帮助选项卡推到列表底部。 如果您想尝试一下,这是一些代码: <?php add_action( "load-options-reading.php", 'wpse_load_reading2' ); function wpse_load_reading2() { get_current_screen()->add_help_tab( array( 'id' => 'my-help-tab', 'title' => __( 'My Title' …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.