mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Revert [18861], [18862], [18864], [18874], [18879], and [18880]. see #18785.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e88d2d7e5b
commit
795ca8d394
@ -1513,13 +1513,15 @@ form.upgrade .hint {
|
|||||||
|
|
||||||
#screen-options-wrap h5,
|
#screen-options-wrap h5,
|
||||||
#contextual-help-wrap h5 {
|
#contextual-help-wrap h5 {
|
||||||
margin: 12px 0 2px;
|
margin: 8px 0;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metabox-prefs label {
|
.metabox-prefs label {
|
||||||
|
display: inline-block;
|
||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
line-height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metabox-prefs label input {
|
.metabox-prefs label input {
|
||||||
|
@ -109,8 +109,7 @@ if ( $post_id )
|
|||||||
else
|
else
|
||||||
$title = __('Comments');
|
$title = __('Comments');
|
||||||
|
|
||||||
$current_screen->add_option( 'per_page', array('label' => _x( 'Comments', 'comments per page (screen options)' )) );
|
add_screen_option( 'per_page', array('label' => _x( 'Comments', 'comments per page (screen options)' )) );
|
||||||
$current_screen->add_option_context( '<p>test</p>' );
|
|
||||||
|
|
||||||
add_contextual_help( $current_screen, '<p>' . __( 'You can manage comments made on your site similar to the way you manage Posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '</p>' .
|
add_contextual_help( $current_screen, '<p>' . __( 'You can manage comments made on your site similar to the way you manage Posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '</p>' .
|
||||||
'<p>' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '</p>' .
|
'<p>' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '</p>' .
|
||||||
|
@ -158,11 +158,7 @@ do_action('do_meta_boxes', $post_type, 'normal', $post);
|
|||||||
do_action('do_meta_boxes', $post_type, 'advanced', $post);
|
do_action('do_meta_boxes', $post_type, 'advanced', $post);
|
||||||
do_action('do_meta_boxes', $post_type, 'side', $post);
|
do_action('do_meta_boxes', $post_type, 'side', $post);
|
||||||
|
|
||||||
$current_screen->add_option('layout_columns', array('max' => 2, 'default' => 2) );
|
add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
|
||||||
'<p>test</p>'
|
|
||||||
);
|
|
||||||
|
|
||||||
if ( 'post' == $post_type ) {
|
if ( 'post' == $post_type ) {
|
||||||
$customize_display = '<p>' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.') . '</p>';
|
$customize_display = '<p>' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.') . '</p>';
|
||||||
@ -170,7 +166,7 @@ if ( 'post' == $post_type ) {
|
|||||||
$current_screen->add_help_tab( array(
|
$current_screen->add_help_tab( array(
|
||||||
'id' => 'customize-display',
|
'id' => 'customize-display',
|
||||||
'title' => __('Customizing This Display'),
|
'title' => __('Customizing This Display'),
|
||||||
'content' => $customize_display
|
'content' => $customize_display,
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$title_and_editor = '<p>' . __('<strong>Title</strong> - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '</p>';
|
$title_and_editor = '<p>' . __('<strong>Title</strong> - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '</p>';
|
||||||
|
@ -37,20 +37,17 @@ do_action('do_meta_boxes', 'link', 'normal', $link);
|
|||||||
do_action('do_meta_boxes', 'link', 'advanced', $link);
|
do_action('do_meta_boxes', 'link', 'advanced', $link);
|
||||||
do_action('do_meta_boxes', 'link', 'side', $link);
|
do_action('do_meta_boxes', 'link', 'side', $link);
|
||||||
|
|
||||||
$current_screen->add_option('layout_columns', array('max' => 2, 'default' => 2) );
|
add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
add_contextual_help($current_screen,
|
||||||
'<p>test</p>'
|
'<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' .
|
||||||
|
'<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' .
|
||||||
|
'<p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/" target="_blank">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>' .
|
||||||
|
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||||
|
'<p>' . __( '<a href="http://codex.wordpress.org/Links_Add_New_Screen" target="_blank">Documentation on Creating Links</a>' ) . '</p>' .
|
||||||
|
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
|
||||||
);
|
);
|
||||||
|
|
||||||
add_contextual_help( $current_screen, '
|
|
||||||
<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>
|
|
||||||
<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>
|
|
||||||
<p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/" target="_blank">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>
|
|
||||||
<p><strong>' . __( 'For more information:' ) . '</strong></p>
|
|
||||||
<p>' . __( '<a href="http://codex.wordpress.org/Links_Add_New_Screen" target="_blank">Documentation on Creating Links</a>' ) . '</p>
|
|
||||||
<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' );
|
|
||||||
|
|
||||||
require_once ('admin-header.php');
|
require_once ('admin-header.php');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -28,11 +28,7 @@ if ( 'post' != $post_type ) {
|
|||||||
$submenu_file = "edit-tags.php?taxonomy=$taxonomy";
|
$submenu_file = "edit-tags.php?taxonomy=$taxonomy";
|
||||||
}
|
}
|
||||||
|
|
||||||
$current_screen->add_option( 'per_page', array('label' => $title, 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page') );
|
add_screen_option( 'per_page', array('label' => $title, 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page') );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
|
||||||
'<p>test</p>'
|
|
||||||
);
|
|
||||||
|
|
||||||
switch ( $wp_list_table->current_action() ) {
|
switch ( $wp_list_table->current_action() ) {
|
||||||
|
|
||||||
|
@ -148,9 +148,6 @@ wp_enqueue_script('inline-edit-post');
|
|||||||
|
|
||||||
$title = $post_type_object->labels->name;
|
$title = $post_type_object->labels->name;
|
||||||
|
|
||||||
$current_screen->add_option( 'per_page', array('label' => $title, 'default' => 20) );
|
|
||||||
$current_screen->add_option_context( '<p>test</p>' );
|
|
||||||
|
|
||||||
if ( 'post' == $post_type ) {
|
if ( 'post' == $post_type ) {
|
||||||
add_contextual_help($current_screen,
|
add_contextual_help($current_screen,
|
||||||
'<p>' . __('You can customize the display of this screen in a number of ways:') . '</p>' .
|
'<p>' . __('You can customize the display of this screen in a number of ways:') . '</p>' .
|
||||||
@ -183,6 +180,8 @@ if ( 'post' == $post_type ) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_screen_option( 'per_page', array('label' => $title, 'default' => 20) );
|
||||||
|
|
||||||
require_once('./admin-header.php');
|
require_once('./admin-header.php');
|
||||||
?>
|
?>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
|
@ -801,103 +801,6 @@ function screen_options( $screen ) {
|
|||||||
* @see WP_Screen::render_screen_meta()
|
* @see WP_Screen::render_screen_meta()
|
||||||
*/
|
*/
|
||||||
function screen_meta( $screen ) {
|
function screen_meta( $screen ) {
|
||||||
_deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_screen_meta()' );
|
|
||||||
|
|
||||||
$current_screen = get_current_screen();
|
$current_screen = get_current_screen();
|
||||||
$current_screen->render_screen_meta();
|
$current_screen->render_screen_meta();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@internal Missing Short Description}}
|
|
||||||
*
|
|
||||||
* @since 2.7.0
|
|
||||||
* @deprecated 3.3.0
|
|
||||||
*/
|
|
||||||
function favorite_actions() {
|
|
||||||
_deprecated_function( __FUNCTION__, '3.3' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Old way of adding contextual help text for a page. Use:
|
|
||||||
* $current_screen->add_help_tab( array(
|
|
||||||
* 'id' => 'my-id', // required
|
|
||||||
* 'title' => __('My Tab'), // required
|
|
||||||
* 'content' => 'help html'
|
|
||||||
* ));
|
|
||||||
*
|
|
||||||
* Creates a 'Screen Info' help tab.
|
|
||||||
*
|
|
||||||
* @since 2.7.0
|
|
||||||
* @deprecated 3.3.0
|
|
||||||
*
|
|
||||||
* @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
|
|
||||||
* @param string $help The content of a 'Screen Info' help tab.
|
|
||||||
*/
|
|
||||||
function add_contextual_help($screen, $help) {
|
|
||||||
//_deprecated_function( __FUNCTION__, '3.3', '$current_screen->add_help_tab()' );
|
|
||||||
|
|
||||||
global $_wp_contextual_help;
|
|
||||||
|
|
||||||
if ( is_string($screen) )
|
|
||||||
$screen = convert_to_screen($screen);
|
|
||||||
|
|
||||||
if ( !isset($_wp_contextual_help) )
|
|
||||||
$_wp_contextual_help = array();
|
|
||||||
|
|
||||||
$_wp_contextual_help[$screen->id] = $help;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Old way of registering and configuring an admin screen option. Use $current_screen->add_option().
|
|
||||||
*
|
|
||||||
* @since 3.1.0
|
|
||||||
* @deprecated 3.3.0
|
|
||||||
*
|
|
||||||
* @param string $option An option name.
|
|
||||||
* @param mixed $args Option dependent arguments
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function add_screen_option( $option, $args = array() ) {
|
|
||||||
//_deprecated_function( __FUNCTION__, '3.3', '$current_screen->add_option()' );
|
|
||||||
|
|
||||||
$current_screen = get_current_screen();
|
|
||||||
|
|
||||||
if ( ! $current_screen )
|
|
||||||
return;
|
|
||||||
|
|
||||||
return $current_screen->add_option( $option, $args );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Output the HTML for hiding metaboxes on the page, use $current_screen->render_metabox_prefs().
|
|
||||||
*
|
|
||||||
* Note that the outputted HTML contains the H5 heading and the DIV class="metabox-prefs".
|
|
||||||
*
|
|
||||||
* @since 2.7.0
|
|
||||||
* @deprecated 3.3.0
|
|
||||||
*
|
|
||||||
* @param mixed $screen
|
|
||||||
*/
|
|
||||||
function meta_box_prefs($screen) {
|
|
||||||
//_deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_metabox_prefs()' );
|
|
||||||
|
|
||||||
$current_screen = get_current_screen();
|
|
||||||
|
|
||||||
if ( ! $current_screen )
|
|
||||||
return;
|
|
||||||
|
|
||||||
return $current_screen->render_metabox_prefs();
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_screen_icon( $screen = '' ) {
|
|
||||||
//_deprecated_function( __FUNCTION__, '3.3', '$current_screen->get_screen_icon()' );
|
|
||||||
|
|
||||||
$current_screen = get_current_screen();
|
|
||||||
|
|
||||||
if ( ! $current_screen )
|
|
||||||
return;
|
|
||||||
|
|
||||||
return $current_screen->get_screen_icon($screen);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* @param string|object $screen The screen you want the headers for
|
* @param string|object $screen The screen you want the headers for
|
||||||
* @return array Containing the headers in the format id => UI String
|
* @return array Containing the headers in the format id => UI String
|
||||||
*/
|
*/
|
||||||
function get_column_headers( $screen ) { // TODO: fold into WP_Screen?
|
function get_column_headers( $screen ) {
|
||||||
if ( is_string( $screen ) )
|
if ( is_string( $screen ) )
|
||||||
$screen = convert_to_screen( $screen );
|
$screen = convert_to_screen( $screen );
|
||||||
|
|
||||||
@ -35,13 +35,48 @@ function get_column_headers( $screen ) { // TODO: fold into WP_Screen?
|
|||||||
* @param string|object $screen The screen you want the hidden columns for
|
* @param string|object $screen The screen you want the hidden columns for
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function get_hidden_columns( $screen ) { // TODO: fold into WP_Screen
|
function get_hidden_columns( $screen ) {
|
||||||
if ( is_string( $screen ) )
|
if ( is_string( $screen ) )
|
||||||
$screen = convert_to_screen( $screen );
|
$screen = convert_to_screen( $screen );
|
||||||
|
|
||||||
return (array) get_user_option( 'manage' . $screen->id . 'columnshidden' );
|
return (array) get_user_option( 'manage' . $screen->id . 'columnshidden' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* @since 2.7.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $screen
|
||||||
|
*/
|
||||||
|
function meta_box_prefs($screen) {
|
||||||
|
global $wp_meta_boxes;
|
||||||
|
|
||||||
|
if ( is_string($screen) )
|
||||||
|
$screen = convert_to_screen($screen);
|
||||||
|
|
||||||
|
if ( empty($wp_meta_boxes[$screen->id]) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
$hidden = get_hidden_meta_boxes($screen);
|
||||||
|
|
||||||
|
foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) {
|
||||||
|
foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) {
|
||||||
|
foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) {
|
||||||
|
if ( false == $box || ! $box['title'] )
|
||||||
|
continue;
|
||||||
|
// Submit box cannot be hidden
|
||||||
|
if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] )
|
||||||
|
continue;
|
||||||
|
$box_id = $box['id'];
|
||||||
|
echo '<label for="' . $box_id . '-hide">';
|
||||||
|
echo '<input class="hide-postbox-tog" name="' . $box_id . '-hide" type="checkbox" id="' . $box_id . '-hide" value="' . $box_id . '"' . (! in_array($box_id, $hidden) ? ' checked="checked"' : '') . ' />';
|
||||||
|
echo "{$box['title']}</label>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Hidden Meta Boxes
|
* Get Hidden Meta Boxes
|
||||||
*
|
*
|
||||||
@ -50,7 +85,7 @@ function get_hidden_columns( $screen ) { // TODO: fold into WP_Screen
|
|||||||
* @param string|object $screen Screen identifier
|
* @param string|object $screen Screen identifier
|
||||||
* @return array Hidden Meta Boxes
|
* @return array Hidden Meta Boxes
|
||||||
*/
|
*/
|
||||||
function get_hidden_meta_boxes( $screen ) { // TODO: fold into WP_Screen
|
function get_hidden_meta_boxes( $screen ) {
|
||||||
if ( is_string( $screen ) )
|
if ( is_string( $screen ) )
|
||||||
$screen = convert_to_screen( $screen );
|
$screen = convert_to_screen( $screen );
|
||||||
|
|
||||||
@ -62,13 +97,124 @@ function get_hidden_meta_boxes( $screen ) { // TODO: fold into WP_Screen
|
|||||||
$hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
|
$hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
|
||||||
else
|
else
|
||||||
$hidden = array( 'slugdiv' );
|
$hidden = array( 'slugdiv' );
|
||||||
|
|
||||||
$hidden = apply_filters('default_hidden_meta_boxes', $hidden, $screen);
|
$hidden = apply_filters('default_hidden_meta_boxes', $hidden, $screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $hidden;
|
return $hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* @since 2.7.0
|
||||||
|
*/
|
||||||
|
function favorite_actions( $screen = null ) {
|
||||||
|
$default_action = false;
|
||||||
|
|
||||||
|
if ( is_string($screen) )
|
||||||
|
$screen = convert_to_screen($screen);
|
||||||
|
|
||||||
|
if ( $screen->is_user )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( isset($screen->post_type) ) {
|
||||||
|
$post_type_object = get_post_type_object($screen->post_type);
|
||||||
|
if ( 'add' != $screen->action )
|
||||||
|
$default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object->cap->edit_posts));
|
||||||
|
else
|
||||||
|
$default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->name, $post_type_object->cap->edit_posts));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !$default_action ) {
|
||||||
|
if ( $screen->is_network ) {
|
||||||
|
$default_action = array('sites.php' => array( __('Sites'), 'manage_sites'));
|
||||||
|
} else {
|
||||||
|
switch ( $screen->id ) {
|
||||||
|
case 'upload':
|
||||||
|
$default_action = array('media-new.php' => array(__('New Media'), 'upload_files'));
|
||||||
|
break;
|
||||||
|
case 'media':
|
||||||
|
$default_action = array('upload.php' => array(__('Edit Media'), 'upload_files'));
|
||||||
|
break;
|
||||||
|
case 'link-manager':
|
||||||
|
case 'link':
|
||||||
|
if ( 'add' != $screen->action )
|
||||||
|
$default_action = array('link-add.php' => array(__('New Link'), 'manage_links'));
|
||||||
|
else
|
||||||
|
$default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links'));
|
||||||
|
break;
|
||||||
|
case 'users':
|
||||||
|
$default_action = array('user-new.php' => array(__('New User'), 'create_users'));
|
||||||
|
break;
|
||||||
|
case 'user':
|
||||||
|
$default_action = array('users.php' => array(__('Edit Users'), 'edit_users'));
|
||||||
|
break;
|
||||||
|
case 'plugins':
|
||||||
|
$default_action = array('plugin-install.php' => array(__('Install Plugins'), 'install_plugins'));
|
||||||
|
break;
|
||||||
|
case 'plugin-install':
|
||||||
|
$default_action = array('plugins.php' => array(__('Manage Plugins'), 'activate_plugins'));
|
||||||
|
break;
|
||||||
|
case 'themes':
|
||||||
|
$default_action = array('theme-install.php' => array(__('Install Themes'), 'install_themes'));
|
||||||
|
break;
|
||||||
|
case 'theme-install':
|
||||||
|
$default_action = array('themes.php' => array(__('Manage Themes'), 'switch_themes'));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$default_action = array('post-new.php' => array(__('New Post'), 'edit_posts'));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !$screen->is_network ) {
|
||||||
|
$actions = array(
|
||||||
|
'post-new.php' => array(__('New Post'), 'edit_posts'),
|
||||||
|
'edit.php?post_status=draft' => array(__('Drafts'), 'edit_posts'),
|
||||||
|
'post-new.php?post_type=page' => array(__('New Page'), 'edit_pages'),
|
||||||
|
'media-new.php' => array(__('Upload'), 'upload_files'),
|
||||||
|
'edit-comments.php' => array(__('Comments'), 'moderate_comments')
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$actions = array(
|
||||||
|
'sites.php' => array( __('Sites'), 'manage_sites'),
|
||||||
|
'users.php' => array( __('Users'), 'manage_network_users')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$default_key = array_keys($default_action);
|
||||||
|
$default_key = $default_key[0];
|
||||||
|
if ( isset($actions[$default_key]) )
|
||||||
|
unset($actions[$default_key]);
|
||||||
|
$actions = array_merge($default_action, $actions);
|
||||||
|
$actions = apply_filters( 'favorite_actions', $actions, $screen );
|
||||||
|
|
||||||
|
$allowed_actions = array();
|
||||||
|
foreach ( $actions as $action => $data ) {
|
||||||
|
if ( current_user_can($data[1]) )
|
||||||
|
$allowed_actions[$action] = $data[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( empty($allowed_actions) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
$first = array_keys($allowed_actions);
|
||||||
|
$first = $first[0];
|
||||||
|
echo '<div id="favorite-actions">';
|
||||||
|
echo '<div id="favorite-first"><a href="' . $first . '">' . $allowed_actions[$first] . '</a></div><div id="favorite-toggle"><br /></div>';
|
||||||
|
echo '<div id="favorite-inside">';
|
||||||
|
|
||||||
|
array_shift($allowed_actions);
|
||||||
|
|
||||||
|
foreach ( $allowed_actions as $action => $label) {
|
||||||
|
echo "<div class='favorite-action'><a href='$action'>";
|
||||||
|
echo $label;
|
||||||
|
echo "</a></div>\n";
|
||||||
|
}
|
||||||
|
echo "</div></div>\n";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a screen string to a screen object
|
* Convert a screen string to a screen object
|
||||||
*
|
*
|
||||||
@ -77,7 +223,7 @@ function get_hidden_meta_boxes( $screen ) { // TODO: fold into WP_Screen
|
|||||||
* @param string $screen The name of the screen
|
* @param string $screen The name of the screen
|
||||||
* @return object An object containing the safe screen name and id
|
* @return object An object containing the safe screen name and id
|
||||||
*/
|
*/
|
||||||
function convert_to_screen( $screen ) { // TODO: fold into WP_Screen?
|
function convert_to_screen( $screen ) {
|
||||||
$screen = str_replace( array('.php', '-new', '-add', '-network', '-user' ), '', $screen);
|
$screen = str_replace( array('.php', '-new', '-add', '-network', '-user' ), '', $screen);
|
||||||
|
|
||||||
if ( is_network_admin() )
|
if ( is_network_admin() )
|
||||||
@ -85,18 +231,86 @@ function convert_to_screen( $screen ) { // TODO: fold into WP_Screen?
|
|||||||
elseif ( is_user_admin() )
|
elseif ( is_user_admin() )
|
||||||
$screen .= '-user';
|
$screen .= '-user';
|
||||||
|
|
||||||
// why do we need this? $screen = (string) apply_filters( 'screen_meta_screen', $screen );
|
$screen = (string) apply_filters( 'screen_meta_screen', $screen );
|
||||||
$screen = (object) array('id' => $screen, 'base' => $screen);
|
$screen = (object) array('id' => $screen, 'base' => $screen);
|
||||||
return $screen;
|
return $screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
function screen_icon( $for = '' ) { // TODO: fold into WP_Screen?
|
/**
|
||||||
global $current_screen;
|
* Add contextual help text for a page.
|
||||||
|
*
|
||||||
|
* Creates a 'Screen Info' help tab.
|
||||||
|
*
|
||||||
|
* @since 2.7.0
|
||||||
|
*
|
||||||
|
* @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
|
||||||
|
* @param string $help The content of a 'Screen Info' help tab.
|
||||||
|
*
|
||||||
|
* @todo: deprecate?
|
||||||
|
*/
|
||||||
|
function add_contextual_help($screen, $help) {
|
||||||
|
global $_wp_contextual_help;
|
||||||
|
|
||||||
if ( !isset($current_screen) )
|
if ( is_string($screen) )
|
||||||
|
$screen = convert_to_screen($screen);
|
||||||
|
|
||||||
|
if ( !isset($_wp_contextual_help) )
|
||||||
|
$_wp_contextual_help = array();
|
||||||
|
|
||||||
|
$_wp_contextual_help[$screen->id] = $help;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register and configure an admin screen option
|
||||||
|
*
|
||||||
|
* @since 3.1.0
|
||||||
|
*
|
||||||
|
* @param string $option An option name.
|
||||||
|
* @param mixed $args Option dependent arguments
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function add_screen_option( $option, $args = array() ) {
|
||||||
|
$current_screen = get_current_screen();
|
||||||
|
|
||||||
|
if ( ! $current_screen )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
echo $current_screen->get_screen_icon( $for );
|
return $current_screen->add_option( $option, $args );
|
||||||
|
}
|
||||||
|
|
||||||
|
function screen_icon( $screen = '' ) {
|
||||||
|
echo get_screen_icon( $screen );
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_screen_icon( $screen = '' ) {
|
||||||
|
global $current_screen, $typenow;
|
||||||
|
|
||||||
|
if ( empty($screen) )
|
||||||
|
$screen = $current_screen;
|
||||||
|
elseif ( is_string($screen) )
|
||||||
|
$name = $screen;
|
||||||
|
|
||||||
|
$class = 'icon32';
|
||||||
|
|
||||||
|
if ( empty($name) ) {
|
||||||
|
if ( !empty($screen->parent_base) )
|
||||||
|
$name = $screen->parent_base;
|
||||||
|
else
|
||||||
|
$name = $screen->base;
|
||||||
|
|
||||||
|
if ( 'edit' == $name && isset($screen->post_type) && 'page' == $screen->post_type )
|
||||||
|
$name = 'edit-pages';
|
||||||
|
|
||||||
|
$post_type = '';
|
||||||
|
if ( isset( $screen->post_type ) )
|
||||||
|
$post_type = $screen->post_type;
|
||||||
|
elseif ( $current_screen == $screen )
|
||||||
|
$post_type = $typenow;
|
||||||
|
if ( $post_type )
|
||||||
|
$class .= ' ' . sanitize_html_class( 'icon32-posts-' . $post_type );
|
||||||
|
}
|
||||||
|
|
||||||
|
return '<div id="icon-' . esc_attr( $name ) . '" class="' . $class . '"><br /></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,13 +338,12 @@ function get_current_screen() {
|
|||||||
*
|
*
|
||||||
* @param string $id Screen id, optional.
|
* @param string $id Screen id, optional.
|
||||||
*/
|
*/
|
||||||
function set_current_screen( $id = '' ) {
|
function set_current_screen( $id = '' ) {
|
||||||
global $current_screen;
|
global $current_screen;
|
||||||
|
|
||||||
if ( !is_a( $current_screen, 'WP_Screen' ) )
|
$current_screen = new WP_Screen( $id );
|
||||||
$current_screen = new WP_Screen( $id );
|
|
||||||
|
|
||||||
// why do we need this? $current_screen = apply_filters('current_screen', $current_screen);
|
$current_screen = apply_filters('current_screen', $current_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -251,19 +464,26 @@ final class WP_Screen {
|
|||||||
* @var array
|
* @var array
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
private $_options = array(
|
private $_options = array();
|
||||||
'_context' => '',
|
|
||||||
'_screen_settings' => ''
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show screen options if any.
|
* Stores the result of the public show_screen_options function.
|
||||||
*
|
*
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
* @var bool
|
* @var bool
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
private $_show_options = false;
|
private $_show_screen_options;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stores the 'screen_settings' section of screen options.
|
||||||
|
*
|
||||||
|
* @since 3.3.0
|
||||||
|
* @var string
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private $_screen_settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -280,19 +500,15 @@ final class WP_Screen {
|
|||||||
if ( empty( $id ) ) {
|
if ( empty( $id ) ) {
|
||||||
$screen = $hook_suffix;
|
$screen = $hook_suffix;
|
||||||
$screen = str_replace('.php', '', $screen);
|
$screen = str_replace('.php', '', $screen);
|
||||||
|
|
||||||
if ( preg_match('/-add|-new$/', $screen) )
|
if ( preg_match('/-add|-new$/', $screen) )
|
||||||
$action = 'add';
|
$action = 'add';
|
||||||
|
|
||||||
$screen = str_replace('-new', '', $screen);
|
$screen = str_replace('-new', '', $screen);
|
||||||
$screen = str_replace('-add', '', $screen);
|
$screen = str_replace('-add', '', $screen);
|
||||||
$this->id = $this->base = $screen;
|
$this->id = $this->base = $screen;
|
||||||
} else {
|
} else {
|
||||||
$id = sanitize_key( $id );
|
$id = sanitize_key( $id );
|
||||||
|
|
||||||
if ( false !== strpos($id, '-') ) {
|
if ( false !== strpos($id, '-') ) {
|
||||||
list( $id, $typenow ) = explode('-', $id, 2);
|
list( $id, $typenow ) = explode('-', $id, 2);
|
||||||
|
|
||||||
if ( taxonomy_exists( $typenow ) ) {
|
if ( taxonomy_exists( $typenow ) ) {
|
||||||
$id = 'edit-tags';
|
$id = 'edit-tags';
|
||||||
$taxnow = $typenow;
|
$taxnow = $typenow;
|
||||||
@ -307,26 +523,22 @@ final class WP_Screen {
|
|||||||
// Map index to dashboard
|
// Map index to dashboard
|
||||||
if ( 'index' == $this->base )
|
if ( 'index' == $this->base )
|
||||||
$this->base = 'dashboard';
|
$this->base = 'dashboard';
|
||||||
|
|
||||||
if ( 'index' == $this->id )
|
if ( 'index' == $this->id )
|
||||||
$this->id = 'dashboard';
|
$this->id = 'dashboard';
|
||||||
|
|
||||||
if ( 'edit' == $this->id ) {
|
if ( 'edit' == $this->id ) {
|
||||||
if ( empty($typenow) )
|
if ( empty($typenow) )
|
||||||
$typenow = 'post';
|
$typenow = 'post';
|
||||||
|
|
||||||
$this->id .= '-' . $typenow;
|
$this->id .= '-' . $typenow;
|
||||||
$this->post_type = $typenow;
|
$this->post_type = $typenow;
|
||||||
} elseif ( 'post' == $this->id ) {
|
} elseif ( 'post' == $this->id ) {
|
||||||
if ( empty($typenow) )
|
if ( empty($typenow) )
|
||||||
$typenow = 'post';
|
$typenow = 'post';
|
||||||
|
|
||||||
$this->id = $typenow;
|
$this->id = $typenow;
|
||||||
$this->post_type = $typenow;
|
$this->post_type = $typenow;
|
||||||
} elseif ( 'edit-tags' == $this->id ) {
|
} elseif ( 'edit-tags' == $this->id ) {
|
||||||
if ( empty($taxnow) )
|
if ( empty($taxnow) )
|
||||||
$taxnow = 'post_tag';
|
$taxnow = 'post_tag';
|
||||||
|
|
||||||
$this->id = 'edit-' . $taxnow;
|
$this->id = 'edit-' . $taxnow;
|
||||||
$this->taxonomy = $taxnow;
|
$this->taxonomy = $taxnow;
|
||||||
}
|
}
|
||||||
@ -359,47 +571,26 @@ final class WP_Screen {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an option for the screen.
|
* Adds an option for the screen.
|
||||||
* Use the 'add_screen_help_and_options' action to add screen options.
|
* Call this in template files after admin.php is loaded and before admin-header.php is loaded to add screen options.
|
||||||
*
|
*
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
*
|
*
|
||||||
* @param string $option Option ID
|
* @param string $option Option ID
|
||||||
* @param mixed $args Associative array of arguments particular to the default $option or the HTML string to be printed in the Screen Options tab.
|
* @param array $args Associative array of arguments particular to the given $option.
|
||||||
*/
|
*/
|
||||||
public function add_option( $option, $args = null ) {
|
public function add_option( $option, $args = array() ) {
|
||||||
if ( is_array($args) && !empty($option) )
|
$this->_options[ $option ] = $args;
|
||||||
$this->_options[ $option ] = $args;
|
|
||||||
elseif ( is_string($option) )
|
|
||||||
$this->_options['_screen_settings'] .= $option;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
$this->_show_options = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds option context.
|
|
||||||
* Use the 'add_screen_help_and_options' action to add it. Will not be shown if there aren't any screen options.
|
|
||||||
*
|
|
||||||
* @since 3.3.0
|
|
||||||
*
|
|
||||||
* @param string $text
|
|
||||||
*/
|
|
||||||
public function add_option_context( $text ) {
|
|
||||||
$this->_options['_context'] .= $text;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a help tab to the contextual help for the screen.
|
* Add a help tab to the contextual help for the screen.
|
||||||
* Use the 'add_screen_help_and_options' action to add contextual help tabs.
|
* Call this in template files after admin.php is loaded and before admin-header.php is loaded to add contextual help tabs.
|
||||||
*
|
*
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
*
|
*
|
||||||
* @param array $args
|
* @param array $args
|
||||||
* - string - title - Title for the tab.
|
* - string - title - Title for the tab.
|
||||||
* - string - id - Tab ID.
|
* - string - id - Tab ID. Optional.
|
||||||
* - string - section - Section title for the tab. Optional.
|
|
||||||
* - string - content - Help tab content in plain text or HTML. Optional.
|
* - string - content - Help tab content in plain text or HTML. Optional.
|
||||||
* - callback - callback - A callback to generate the tab content. Optional.
|
* - callback - callback - A callback to generate the tab content. Optional.
|
||||||
*
|
*
|
||||||
@ -408,31 +599,32 @@ final class WP_Screen {
|
|||||||
$defaults = array(
|
$defaults = array(
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'id' => false,
|
'id' => false,
|
||||||
'section' => false,
|
|
||||||
'content' => '',
|
'content' => '',
|
||||||
'callback' => false
|
'callback' => false,
|
||||||
);
|
);
|
||||||
$args = wp_parse_args( $args, $defaults );
|
$args = wp_parse_args( $args, $defaults );
|
||||||
|
|
||||||
// Ensure we have title and ID.
|
// Ensure we have a title.
|
||||||
if ( ! $args['title'] || ! $args['id'] )
|
if ( ! $args['title'] )
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
|
// Create an id from the title if one is not provided.
|
||||||
|
if ( ! $args['id'] )
|
||||||
|
$args['id'] = sanitize_html_class( $args['title'] );
|
||||||
|
|
||||||
$this->_help_tabs[] = $args;
|
$this->_help_tabs[] = $args;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a sidebar to the contextual help for the screen.
|
* Add a sidebar to the contextual help for the screen.
|
||||||
* Use the 'add_screen_help_and_options' action to add a sidebar to the contextual help.
|
* Call this in template files after admin.php is loaded and before admin-header.php is loaded to add a sidebar to the contextual help.
|
||||||
*
|
*
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
*
|
*
|
||||||
* @param string $content Sidebar content in plain text or HTML.
|
* @param string $content Sidebar content in plain text or HTML.
|
||||||
*/
|
*/
|
||||||
public function add_help_sidebar( $content ) {
|
public function add_help_sidebar( $content ) {
|
||||||
if ( empty($this->_help_sidebar) ) // add only one
|
$this->_help_sidebar = $content;
|
||||||
$this->_help_sidebar = $content;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -445,24 +637,26 @@ final class WP_Screen {
|
|||||||
public function render_screen_meta() {
|
public function render_screen_meta() {
|
||||||
global $_wp_contextual_help;
|
global $_wp_contextual_help;
|
||||||
|
|
||||||
// Intended for adding Help and Screen Options.
|
|
||||||
do_action('add_screen_help_and_options', $this);
|
|
||||||
|
|
||||||
// Call old contextual_help_list filter.
|
// Call old contextual_help_list filter.
|
||||||
if ( ! isset( $_wp_contextual_help ) )
|
if ( ! isset( $_wp_contextual_help ) )
|
||||||
$_wp_contextual_help = array();
|
$_wp_contextual_help = array();
|
||||||
|
$_wp_contextual_help = apply_filters( 'contextual_help_list', $_wp_contextual_help, $this );
|
||||||
// why are we filtering a global? $_wp_contextual_help = apply_filters( 'contextual_help_list', $_wp_contextual_help, $this );
|
|
||||||
|
|
||||||
if ( isset( $_wp_contextual_help[ $this->id ] ) ) {
|
if ( isset( $_wp_contextual_help[ $this->id ] ) ) {
|
||||||
// Call old contextual_help filter.
|
// Call old contextual_help filter.
|
||||||
// why are we filtering the same global second time??
|
|
||||||
$contextual_help = apply_filters( 'contextual_help', $_wp_contextual_help[ $this->id ], $this->id, $this );
|
$contextual_help = apply_filters( 'contextual_help', $_wp_contextual_help[ $this->id ], $this->id, $this );
|
||||||
|
|
||||||
$this->add_help_tab( array(
|
$this->add_help_tab( array(
|
||||||
'title' => __('Screen Info'),
|
'title' => __('Screen Info'),
|
||||||
'id' => 'screen-info',
|
'content' => $contextual_help,
|
||||||
'content' => $_wp_contextual_help[ $this->id ]
|
) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add screen options tab
|
||||||
|
if ( $this->show_screen_options() ) {
|
||||||
|
$this->add_help_tab( array(
|
||||||
|
'title' => __('Screen Options'),
|
||||||
|
'callback' => array( $this, 'render_screen_options' ),
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -473,60 +667,35 @@ final class WP_Screen {
|
|||||||
<div id="contextual-help-wrap" class="hidden">
|
<div id="contextual-help-wrap" class="hidden">
|
||||||
<div class="contextual-help-tabs">
|
<div class="contextual-help-tabs">
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php foreach ( $this->_help_tabs as $i => $tab ):
|
||||||
|
$link_id = "tab-link-{$tab['id']}";
|
||||||
if ( $this->_show_options ) {
|
$panel_id = "tab-panel-{$tab['id']}";
|
||||||
$class = true;
|
$classes = ( $i == 0 ) ? 'active' : '';
|
||||||
?>
|
?>
|
||||||
<li id="tab-link-screen-options" class="active">
|
|
||||||
<a href="#tab-panel-screen-options">
|
|
||||||
<?php _e('Screen Options'); ?>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ( $this->_help_tabs as $i => $tab ) {
|
<li id="<?php echo esc_attr( $link_id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
|
||||||
$id = esc_attr($tab['id']);
|
<a href="<?php echo esc_url( "#$panel_id" ); ?>">
|
||||||
$class = empty($class) && $i == 0 ? ' class="active"' : '';
|
|
||||||
?>
|
|
||||||
<li id="<?php echo "tab-link-$id"; ?>"<?php echo $class; ?>>
|
|
||||||
<a href="<?php echo "#tab-panel-$id"; ?>">
|
|
||||||
<?php echo esc_html( $tab['title'] ); ?>
|
<?php echo esc_html( $tab['title'] ); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
|
||||||
|
|
||||||
if ( $this->_help_sidebar )
|
<div class="contextual-help-sidebar">
|
||||||
echo '<div class="contextual-help-sidebar">' . $this->_help_sidebar . '</div>';
|
<?php echo $this->_help_sidebar; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
?>
|
|
||||||
<div class="contextual-help-tabs-wrap">
|
<div class="contextual-help-tabs-wrap">
|
||||||
<?php
|
<?php foreach ( $this->_help_tabs as $i => $tab ):
|
||||||
|
$panel_id = "tab-panel-{$tab['id']}";
|
||||||
if ( $this->_show_options ) {
|
$classes = ( $i == 0 ) ? 'active' : '';
|
||||||
$class2 = true;
|
$classes .= ' help-tab-content';
|
||||||
echo '<div id="tab-panel-screen-options" class="help-tab-content active">';
|
|
||||||
|
|
||||||
if ( !empty($this->_options['_context']) )
|
|
||||||
echo $this->_options['_context'];
|
|
||||||
|
|
||||||
$this->render_screen_options();
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ( $this->_help_tabs as $i => $tab ) {
|
|
||||||
$class2 = empty($class2) && $i == 0 ? ' active' : '';
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="<?php echo esc_attr( "tab-panel-{$tab['id']}" ); ?>" class="help-tab-content<?php echo $class2; ?>">
|
<div id="<?php echo esc_attr( $panel_id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
|
||||||
|
<h3><?php echo esc_html( $tab['title'] ); ?></h3>
|
||||||
<?php
|
<?php
|
||||||
if ( $tab['section'] )
|
|
||||||
echo '<h3>' . esc_html( $tab['section'] ) . '</h3>';
|
|
||||||
|
|
||||||
// Print tab content.
|
// Print tab content.
|
||||||
echo $tab['content'];
|
echo $tab['content'];
|
||||||
|
|
||||||
@ -535,57 +704,68 @@ final class WP_Screen {
|
|||||||
call_user_func( $tab['callback'], $this );
|
call_user_func( $tab['callback'], $this );
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function show_screen_options() {
|
||||||
|
global $wp_meta_boxes, $wp_list_table;
|
||||||
|
|
||||||
|
if ( is_bool( $this->_show_screen_options ) )
|
||||||
|
return $this->_show_screen_options;
|
||||||
|
|
||||||
|
$columns = get_column_headers( $this );
|
||||||
|
|
||||||
|
$show_screen = false;
|
||||||
|
if ( ! empty( $wp_meta_boxes[ $this->id ] ) || ! empty( $columns ) )
|
||||||
|
$show_screen = true;
|
||||||
|
|
||||||
|
// Check if there are per-page options.
|
||||||
|
$show_screen = $show_screen || isset( $this->_options['per_page'] );
|
||||||
|
|
||||||
|
$this->_screen_settings = apply_filters( 'screen_settings', '', $this );
|
||||||
|
|
||||||
|
switch ( $this->id ) {
|
||||||
|
case 'widgets':
|
||||||
|
$this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
|
||||||
|
$show_screen = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! empty( $this->_screen_settings ) )
|
||||||
|
$show_screen = true;
|
||||||
|
|
||||||
|
if ( ! empty( $this->_options ) )
|
||||||
|
$show_screen = true;
|
||||||
|
|
||||||
|
$this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
|
||||||
|
return $this->_show_screen_options;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the screen options tab.
|
* Render the screen options tab.
|
||||||
*
|
*
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
*/
|
*/
|
||||||
public function render_screen_options() {
|
public function render_screen_options() {
|
||||||
|
global $wp_meta_boxes, $wp_list_table;
|
||||||
|
|
||||||
$screen_settings = $this->_options['_screen_settings'];
|
|
||||||
|
|
||||||
// Default screen_settings for various screens.
|
|
||||||
// TODO: should probably be set on these screens, not here.
|
|
||||||
switch ( $this->id ) {
|
|
||||||
case 'widgets':
|
|
||||||
$screen_settings .= '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: deprecate
|
|
||||||
$screen_settings = apply_filters( 'screen_settings', $screen_settings, $this );
|
|
||||||
|
|
||||||
echo '<form id="adv-settings" action="" method="post">';
|
|
||||||
|
|
||||||
$this->render_table_columns_prefs();
|
|
||||||
$this->render_metabox_prefs();
|
|
||||||
$this->render_screen_layout();
|
|
||||||
$this->render_per_page_options();
|
|
||||||
echo $screen_settings;
|
|
||||||
|
|
||||||
wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false );
|
|
||||||
echo '</form>';
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Render the option for hiding table columns on the page
|
|
||||||
*
|
|
||||||
* @since 3.3.0
|
|
||||||
*/
|
|
||||||
function render_table_columns_prefs() {
|
|
||||||
$columns = get_column_headers( $this );
|
$columns = get_column_headers( $this );
|
||||||
|
$hidden = get_hidden_columns( $this );
|
||||||
|
|
||||||
if ( ! empty( $columns ) ) {
|
?>
|
||||||
$hidden = get_hidden_columns( $this );
|
<form id="adv-settings" action="" method="post">
|
||||||
?>
|
<?php if ( isset( $wp_meta_boxes[ $this->id ] ) ) : ?>
|
||||||
|
<h5><?php _ex('Show on screen', 'Metaboxes') ?></h5>
|
||||||
|
<div class="metabox-prefs">
|
||||||
|
<?php meta_box_prefs( $this ); ?>
|
||||||
|
<br class="clear" />
|
||||||
|
</div>
|
||||||
|
<?php endif;
|
||||||
|
if ( ! empty( $columns ) ) : ?>
|
||||||
<h5><?php echo ( isset( $columns['_title'] ) ? $columns['_title'] : _x('Show on screen', 'Columns') ) ?></h5>
|
<h5><?php echo ( isset( $columns['_title'] ) ? $columns['_title'] : _x('Show on screen', 'Columns') ) ?></h5>
|
||||||
<div class="metabox-prefs">
|
<div class="metabox-prefs">
|
||||||
<?php
|
<?php
|
||||||
@ -600,7 +780,6 @@ final class WP_Screen {
|
|||||||
|
|
||||||
if ( 'comments' == $column )
|
if ( 'comments' == $column )
|
||||||
$title = __( 'Comments' );
|
$title = __( 'Comments' );
|
||||||
|
|
||||||
$id = "$column-hide";
|
$id = "$column-hide";
|
||||||
echo '<label for="' . $id . '">';
|
echo '<label for="' . $id . '">';
|
||||||
echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( !in_array($column, $hidden), true, false ) . ' />';
|
echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( !in_array($column, $hidden), true, false ) . ' />';
|
||||||
@ -609,45 +788,16 @@ final class WP_Screen {
|
|||||||
?>
|
?>
|
||||||
<br class="clear" />
|
<br class="clear" />
|
||||||
</div>
|
</div>
|
||||||
<?php }
|
<?php endif;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$this->render_screen_layout();
|
||||||
* Render the option for hiding metaboxes on the page
|
$this->render_per_page_options();
|
||||||
*
|
echo $this->_screen_settings;
|
||||||
* @since 3.3.0
|
|
||||||
*/
|
|
||||||
function render_metabox_prefs() {
|
|
||||||
global $wp_meta_boxes;
|
|
||||||
|
|
||||||
if ( !empty( $wp_meta_boxes[ $this->id ] ) ) {
|
?>
|
||||||
$hidden = get_hidden_meta_boxes($this);
|
<div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
|
||||||
?>
|
</form>
|
||||||
<h5><?php _ex('Show on screen', 'Metaboxes') ?></h5>
|
<?php
|
||||||
<div class="metabox-prefs">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
foreach ( array_keys($wp_meta_boxes[$this->id]) as $context ) {
|
|
||||||
foreach ( array_keys($wp_meta_boxes[$this->id][$context]) as $priority ) {
|
|
||||||
foreach ( $wp_meta_boxes[$this->id][$context][$priority] as $box ) {
|
|
||||||
if ( false == $box || ! $box['title'] )
|
|
||||||
continue;
|
|
||||||
// Submit box cannot be hidden
|
|
||||||
if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] )
|
|
||||||
continue;
|
|
||||||
$box_id = $box['id'];
|
|
||||||
echo '<label for="' . $box_id . '-hide">';
|
|
||||||
echo '<input class="hide-postbox-tog" name="' . $box_id . '-hide" type="checkbox" id="' . $box_id . '-hide" value="' . $box_id . '"' . (! in_array($box_id, $hidden) ? ' checked="checked"' : '') . ' />';
|
|
||||||
echo "{$box['title']}</label>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<br class="clear" />
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -659,11 +809,10 @@ final class WP_Screen {
|
|||||||
global $screen_layout_columns;
|
global $screen_layout_columns;
|
||||||
|
|
||||||
// Back compat for plugins using the filter instead of add_screen_option()
|
// Back compat for plugins using the filter instead of add_screen_option()
|
||||||
// TODO: deprecate it
|
|
||||||
$columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );
|
$columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );
|
||||||
|
|
||||||
if ( ! empty( $columns ) && isset( $columns[ $this->id ] ) )
|
if ( ! empty( $columns ) && isset( $columns[ $this->id ] ) )
|
||||||
$this->add_option( 'layout_columns', array('max' => $columns[ $this->id ] ) );
|
add_screen_option( 'layout_columns', array('max' => $columns[ $this->id ] ) );
|
||||||
|
|
||||||
if ( ! isset( $this->_options['layout_columns'] ) ) {
|
if ( ! isset( $this->_options['layout_columns'] ) ) {
|
||||||
$screen_layout_columns = 0;
|
$screen_layout_columns = 0;
|
||||||
@ -701,7 +850,7 @@ final class WP_Screen {
|
|||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
*/
|
*/
|
||||||
function render_per_page_options() {
|
function render_per_page_options() {
|
||||||
if ( empty( $this->_options['per_page'] ) )
|
if ( ! isset( $this->_options['per_page'] ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$per_page_label = $this->_options['per_page']['label'];
|
$per_page_label = $this->_options['per_page']['label'];
|
||||||
@ -750,26 +899,4 @@ final class WP_Screen {
|
|||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function get_screen_icon( $for = '' ) {
|
|
||||||
|
|
||||||
if ( !empty($for) && is_string($for) ) {
|
|
||||||
$name = $for;
|
|
||||||
} else {
|
|
||||||
if ( !empty($this->parent_base) )
|
|
||||||
$name = $this->parent_base;
|
|
||||||
else
|
|
||||||
$name = $this->base;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( 'edit' == $name && isset($this->post_type) && 'page' == $this->post_type )
|
|
||||||
$name = 'edit-pages';
|
|
||||||
|
|
||||||
$class = '';
|
|
||||||
if ( !empty( $this->post_type ) )
|
|
||||||
$class = ' ' . sanitize_html_class( 'icon32-posts-' . $this->post_type );
|
|
||||||
|
|
||||||
return '<div id="icon-' . esc_attr( $name ) . '" class="icon32' . $class . '"><br /></div>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -23,65 +23,58 @@ $title = __('Dashboard');
|
|||||||
$parent_file = 'index.php';
|
$parent_file = 'index.php';
|
||||||
|
|
||||||
if ( is_user_admin() )
|
if ( is_user_admin() )
|
||||||
$current_screen->add_option('layout_columns', array('max' => 4, 'default' => 1) );
|
add_screen_option('layout_columns', array('max' => 4, 'default' => 1) );
|
||||||
else
|
else
|
||||||
$current_screen->add_option('layout_columns', array('max' => 4, 'default' => 2) );
|
add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
|
||||||
'<p>test</p>'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Help tabs
|
// Help tabs
|
||||||
|
|
||||||
$help = '<p>' . __('Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the top bar.') . '</p>';
|
$help_overview = '<p>' . __('Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the top bar.') . '</p>';
|
||||||
|
|
||||||
$current_screen->add_help_tab( array(
|
$current_screen->add_help_tab( array(
|
||||||
'title' => __('Overview'),
|
'title' => __('Overview'),
|
||||||
'id' => 'overview',
|
'content' => $help_overview,
|
||||||
'content' => $help
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$help = '<p>' . __('The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.') . '</p>
|
$help_navigation = '<p>' . __('The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.') . '</p>';
|
||||||
<p>' . __('Links in the “admin bar” at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.') . '</p>';
|
$help_navigation .= '<p>' . __('Links in the “admin bar” at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.') . '</p>';
|
||||||
|
|
||||||
$current_screen->add_help_tab( array(
|
$current_screen->add_help_tab( array(
|
||||||
'title' => __('Navigation'),
|
'title' => __('Navigation'),
|
||||||
'id' => 'navigation',
|
'content' => $help_navigation,
|
||||||
'content' => $help
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$help = '<p>' . __('You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.') . '</p>
|
$help_layout = '<p>' . __('You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.') . '</p>';
|
||||||
<p>' . __('<strong>Screen Options</strong> - Use the Screen Options tab to choose which Dashboard boxes to show, and how many columns to display.') . '</p>
|
$help_layout .= '<p>' . __('<strong>Screen Options</strong> - Use the Screen Options tab to choose which Dashboard boxes to show, and how many columns to display.') . '</p>';
|
||||||
<p>' . __('<strong>Drag and Drop</strong> - To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.') . '</p>
|
$help_layout .= '<p>' . __('<strong>Drag and Drop</strong> - To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.') . '</p>';
|
||||||
<p>' . __('<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some box have configurable content, and will show a “Configure” link in the title bar if you hover over it.') . '</p>';
|
$help_layout .= '<p>' . __('<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some box have configurable content, and will show a “Configure” link in the title bar if you hover over it.') . '</p>';
|
||||||
|
|
||||||
$current_screen->add_help_tab( array(
|
$current_screen->add_help_tab( array(
|
||||||
'title' => __('Layout'),
|
'title' => __('Layout'),
|
||||||
'id' => 'layout',
|
'content' => $help_layout,
|
||||||
'content' => $help
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$help = '<p>' . __('The boxes on your Dashboard screen are:') . '</p>
|
$help_content = '<p>' . __('The boxes on your Dashboard screen are:') . '</p>';
|
||||||
<p>' . __('<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '</p>
|
$help_content .= '<p>' . __('<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '</p>';
|
||||||
<p>' . __('<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.') . '</p>
|
$help_content .= '<p>' . __('<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.') . '</p>';
|
||||||
<p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.') . '</p>
|
$help_content .= '<p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.') . '</p>';
|
||||||
<p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.') . '</p>
|
$help_content .= '<p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.') . '</p>';
|
||||||
<p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you’ve started.') . '</p>
|
$help_content .= '<p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you’ve started.') . '</p>';
|
||||||
<p>' . __('<strong>WordPress Blog</strong> - Latest news from the official WordPress project.') . '</p>
|
$help_content .= '<p>' . __('<strong>WordPress Blog</strong> - Latest news from the official WordPress project.') . '</p>';
|
||||||
<p>' . __('<strong>Other WordPress News</strong> - Shows the <a href="http://planet.wordpress.org" target="_blank">WordPress Planet</a> feed. You can configure it to show a different feed of your choosing.') . '</p>
|
$help_content .= '<p>' . __('<strong>Other WordPress News</strong> - Shows the <a href="http://planet.wordpress.org" target="_blank">WordPress Planet</a> feed. You can configure it to show a different feed of your choosing.') . '</p>';
|
||||||
<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>';
|
$help_content .= '<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>';
|
||||||
|
|
||||||
$current_screen->add_help_tab( array(
|
$current_screen->add_help_tab( array(
|
||||||
'title' => __('Content'),
|
'title' => __('Content'),
|
||||||
'id' => 'content',
|
'content' => $help_content,
|
||||||
'content' => $help
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$current_screen->add_help_sidebar('
|
$current_screen->add_help_sidebar(
|
||||||
<p><strong>' . __( 'For more information:' ) . '</strong></p>
|
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||||
<p>' . __( '<a href="http://codex.wordpress.org/Dashboard_Screen" target="_blank">Documentation on Dashboard</a>' ) . '</p>
|
'<p>' . __( '<a href="http://codex.wordpress.org/Dashboard_Screen" target="_blank">Documentation on Dashboard</a>' ) . '</p>' .
|
||||||
<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>
|
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
|
||||||
');
|
);
|
||||||
|
|
||||||
|
|
||||||
include (ABSPATH . 'wp-admin/admin-header.php');
|
include (ABSPATH . 'wp-admin/admin-header.php');
|
||||||
|
@ -40,10 +40,6 @@ $wp_list_table->prepare_items();
|
|||||||
$title = __('Links');
|
$title = __('Links');
|
||||||
$this_file = $parent_file = 'link-manager.php';
|
$this_file = $parent_file = 'link-manager.php';
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
|
||||||
'<p>test</p>'
|
|
||||||
);
|
|
||||||
|
|
||||||
add_contextual_help( $current_screen,
|
add_contextual_help( $current_screen,
|
||||||
'<p>' . sprintf(__('You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.'), 'widgets.php') . '</p>' .
|
'<p>' . sprintf(__('You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.'), 'widgets.php') . '</p>' .
|
||||||
'<p>' . __('Links may be separated into categories; these are different than the categories used on your posts.') . '</p>' .
|
'<p>' . __('Links may be separated into categories; these are different than the categories used on your posts.') . '</p>' .
|
||||||
|
@ -445,17 +445,14 @@ wp_initial_nav_menu_meta_boxes();
|
|||||||
if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() )
|
if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() )
|
||||||
$messages[] = '<div id="message" class="updated"><p>' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '</p></div>';
|
$messages[] = '<div id="message" class="updated"><p>' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '</p></div>';
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
$help = '<p>' . __('This feature allows you to use a custom menu in place of your theme’s default menus. If your theme does not support the custom menus feature yet (the new and old default themes, Twenty Eleven and Twenty Ten, do), you can learn about adding this support by following the Documentation link in this tab. You can still use the “Custom Menu” widget to add menus to a sidebar.') . '</p>';
|
||||||
'<p>test</p>'
|
$help .= '<p>' . __('You can create custom menus for your site. These menus may contain links to pages, categories, custom links or other content types (use the Screen Options tab to decide which ones to show on the screen). You can specify a different navigation label for a menu item as well as other attributes. You can create multiple menus. If your theme includes more than one menu, you can choose which custom menu to associate with each. You can also use custom menus in conjunction with the Custom Menus widget.') . '</p>';
|
||||||
);
|
$help .= '<p>' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You’ll be able to edit the information for each menu item, and can drag and drop to put them in order. You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy. Drop the item into its new nested placement when the dotted rectangle target shifts over, also a little to the right. Don’t forget to click Save when you’re finished.') . '</p>';
|
||||||
|
$help .= '<p><strong>' . __('For more information:') . '</strong></p>';
|
||||||
|
$help .= '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Menus_Screen" target="_blank">Documentation on Menus</a>') . '</p>';
|
||||||
|
$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
|
||||||
|
|
||||||
add_contextual_help( $current_screen, '
|
add_contextual_help($current_screen, $help);
|
||||||
<p>' . __('This feature allows you to use a custom menu in place of your theme’s default menus. If your theme does not support the custom menus feature yet (the new and old default themes, Twenty Eleven and Twenty Ten, do), you can learn about adding this support by following the Documentation link in this tab. You can still use the “Custom Menu” widget to add menus to a sidebar.') . '</p>
|
|
||||||
<p>' . __('You can create custom menus for your site. These menus may contain links to pages, categories, custom links or other content types (use the Screen Options tab to decide which ones to show on the screen). You can specify a different navigation label for a menu item as well as other attributes. You can create multiple menus. If your theme includes more than one menu, you can choose which custom menu to associate with each. You can also use custom menus in conjunction with the Custom Menus widget.') . '</p>
|
|
||||||
<p>' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You’ll be able to edit the information for each menu item, and can drag and drop to put them in order. You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy. Drop the item into its new nested placement when the dotted rectangle target shifts over, also a little to the right. Don’t forget to click Save when you’re finished.') . '</p>
|
|
||||||
<p><strong>' . __('For more information:') . '</strong></p>
|
|
||||||
<p>' . __('<a href="http://codex.wordpress.org/Appearance_Menus_Screen" target="_blank">Documentation on Menus</a>') . '</p>
|
|
||||||
<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' );
|
|
||||||
|
|
||||||
// Get the admin header
|
// Get the admin header
|
||||||
require_once( './admin-header.php' );
|
require_once( './admin-header.php' );
|
||||||
|
@ -38,11 +38,7 @@ wp_enqueue_script( 'dashboard' );
|
|||||||
wp_enqueue_script( 'plugin-install' );
|
wp_enqueue_script( 'plugin-install' );
|
||||||
add_thickbox();
|
add_thickbox();
|
||||||
|
|
||||||
$current_screen->add_option('layout_columns', array('max' => 4, 'default' => 2) );
|
add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
|
||||||
'<p>test</p>'
|
|
||||||
);
|
|
||||||
|
|
||||||
require_once( '../admin-header.php' );
|
require_once( '../admin-header.php' );
|
||||||
|
|
||||||
|
@ -122,11 +122,7 @@ if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add_thickbox();
|
add_thickbox();
|
||||||
$current_screen->add_option( 'per_page', array( 'label' => _x( 'Themes', 'themes per page (screen options)' ) ) );
|
add_screen_option( 'per_page', array( 'label' => _x( 'Themes', 'themes per page (screen options)' ) ) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
|
||||||
'<p>test</p>'
|
|
||||||
);
|
|
||||||
|
|
||||||
$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) );
|
$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) );
|
||||||
$title_site_url_linked = sprintf( __('Edit Site: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id( $id ), $site_url_no_http );
|
$title_site_url_linked = sprintf( __('Edit Site: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id( $id ), $site_url_no_http );
|
||||||
|
@ -153,11 +153,7 @@ if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$current_screen->add_option( 'per_page', array( 'label' => _x( 'Users', 'users per page (screen options)' ) ) );
|
add_screen_option( 'per_page', array( 'label' => _x( 'Users', 'users per page (screen options)' ) ) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
|
||||||
'<p>test</p>'
|
|
||||||
);
|
|
||||||
|
|
||||||
$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) );
|
$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) );
|
||||||
$title_site_url_linked = sprintf( __('Edit Site: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id( $id ), $site_url_no_http );
|
$title_site_url_linked = sprintf( __('Edit Site: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id( $id ), $site_url_no_http );
|
||||||
|
@ -22,11 +22,7 @@ $pagenum = $wp_list_table->get_pagenum();
|
|||||||
$title = __( 'Sites' );
|
$title = __( 'Sites' );
|
||||||
$parent_file = 'sites.php';
|
$parent_file = 'sites.php';
|
||||||
|
|
||||||
$current_screen->add_option( 'per_page', array('label' => _x( 'Sites', 'sites per page (screen options)' )) );
|
add_screen_option( 'per_page', array('label' => _x( 'Sites', 'sites per page (screen options)' )) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
|
||||||
'<p>test</p>'
|
|
||||||
);
|
|
||||||
|
|
||||||
add_contextual_help($current_screen,
|
add_contextual_help($current_screen,
|
||||||
'<p>' . __('Add New takes you to the Add New Site screen. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.') . '</p>' .
|
'<p>' . __('Add New takes you to the Add New Site screen. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.') . '</p>' .
|
||||||
|
@ -201,11 +201,7 @@ $wp_list_table->prepare_items();
|
|||||||
|
|
||||||
add_thickbox();
|
add_thickbox();
|
||||||
|
|
||||||
$current_screen->add_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' )) );
|
add_screen_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' )) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
|
||||||
'<p>test</p>'
|
|
||||||
);
|
|
||||||
|
|
||||||
add_contextual_help($current_screen,
|
add_contextual_help($current_screen,
|
||||||
'<p>' . __('This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.') . '</p>' .
|
'<p>' . __('This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.') . '</p>' .
|
||||||
|
@ -227,11 +227,7 @@ if ( $pagenum > $total_pages && $total_pages > 0 ) {
|
|||||||
$title = __( 'Users' );
|
$title = __( 'Users' );
|
||||||
$parent_file = 'users.php';
|
$parent_file = 'users.php';
|
||||||
|
|
||||||
$current_screen->add_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) );
|
add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
|
||||||
'<p>test</p>'
|
|
||||||
);
|
|
||||||
|
|
||||||
add_contextual_help($current_screen,
|
add_contextual_help($current_screen,
|
||||||
'<p>' . __('This table shows all users across the network and the sites to which they are assigned.') . '</p>' .
|
'<p>' . __('This table shows all users across the network and the sites to which they are assigned.') . '</p>' .
|
||||||
|
@ -35,19 +35,16 @@ $body_id = $tab;
|
|||||||
|
|
||||||
do_action('install_plugins_pre_' . $tab); //Used to override the general interface, Eg, install or plugin information.
|
do_action('install_plugins_pre_' . $tab); //Used to override the general interface, Eg, install or plugin information.
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
add_contextual_help($current_screen,
|
||||||
'<p>test</p>'
|
'<p>' . sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from WordPress core by thousands of developers all over the world. All plugins in the official <a href="%s" target="_blank">WordPress.org Plugin Directory</a> are compatible with the license WordPress uses. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'http://wordpress.org/extend/plugins/') . '</p>' .
|
||||||
|
'<p>' . __('If you know what you’re looking for, Search is your best bet. The Search screen has options to search the WordPress.org Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting a popular tags. Tags in larger type mean more plugins have been labeled with that tag.') . '</p>' .
|
||||||
|
'<p>' . __('If you just want to get an idea of what’s available, you can browse Featured, Popular, Newest, and Recently Updated plugins by using the links in the upper left of the screen. These sections rotate regularly.') . '</p>' .
|
||||||
|
'<p>' . __('If you want to install a plugin that you’ve downloaded elsewhere, click Upload in the upper left. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.') . '</p>' .
|
||||||
|
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||||
|
'<p>' . __('<a href="http://codex.wordpress.org/Plugins_Add_New_Screen" target="_blank">Documentation on Installing Plugins</a>') . '</p>' .
|
||||||
|
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||||
);
|
);
|
||||||
|
|
||||||
add_contextual_help( $current_screen, '
|
|
||||||
<p>' . sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from WordPress core by thousands of developers all over the world. All plugins in the official <a href="%s" target="_blank">WordPress.org Plugin Directory</a> are compatible with the license WordPress uses. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'http://wordpress.org/extend/plugins/') . '</p>
|
|
||||||
<p>' . __('If you know what you’re looking for, Search is your best bet. The Search screen has options to search the WordPress.org Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting a popular tags. Tags in larger type mean more plugins have been labeled with that tag.') . '</p>
|
|
||||||
<p>' . __('If you just want to get an idea of what’s available, you can browse Featured, Popular, Newest, and Recently Updated plugins by using the links in the upper left of the screen. These sections rotate regularly.') . '</p>
|
|
||||||
<p>' . __('If you want to install a plugin that you’ve downloaded elsewhere, click Upload in the upper left. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.') . '</p>
|
|
||||||
<p><strong>' . __('For more information:') . '</strong></p>
|
|
||||||
<p>' . __('<a href="http://codex.wordpress.org/Plugins_Add_New_Screen" target="_blank">Documentation on Installing Plugins</a>') . '</p>
|
|
||||||
<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' );
|
|
||||||
|
|
||||||
include(ABSPATH . 'wp-admin/admin-header.php');
|
include(ABSPATH . 'wp-admin/admin-header.php');
|
||||||
?>
|
?>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
|
@ -316,21 +316,18 @@ $wp_list_table->prepare_items();
|
|||||||
wp_enqueue_script('plugin-install');
|
wp_enqueue_script('plugin-install');
|
||||||
add_thickbox();
|
add_thickbox();
|
||||||
|
|
||||||
$current_screen->add_option( 'per_page', array('label' => _x( 'Plugins', 'plugins per page (screen options)' ), 'default' => 999 ) );
|
add_screen_option( 'per_page', array('label' => _x( 'Plugins', 'plugins per page (screen options)' ), 'default' => 999 ) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
add_contextual_help($current_screen,
|
||||||
'<p>test</p>'
|
'<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' .
|
||||||
|
'<p>' . sprintf(__('You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your <code>/wp-content/plugins</code> directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'http://wordpress.org/extend/plugins/') . '</p>' .
|
||||||
|
'<p>' . __('Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin’s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.') . '</p>' .
|
||||||
|
'<p>' . sprintf( __('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), WP_PLUGIN_DIR) . '</p>' .
|
||||||
|
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||||
|
'<p>' . __('<a href="http://codex.wordpress.org/Managing_Plugins#Plugin_Management" target="_blank">Documentation on Managing Plugins</a>') . '</p>' .
|
||||||
|
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||||
);
|
);
|
||||||
|
|
||||||
add_contextual_help( $current_screen, '
|
|
||||||
<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>
|
|
||||||
<p>' . sprintf(__('You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your <code>/wp-content/plugins</code> directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'http://wordpress.org/extend/plugins/') . '</p>
|
|
||||||
<p>' . __('Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin’s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.') . '</p>
|
|
||||||
<p>' . sprintf( __('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), WP_PLUGIN_DIR) . '</p>
|
|
||||||
<p><strong>' . __('For more information:') . '</strong></p>
|
|
||||||
<p>' . __('<a href="http://codex.wordpress.org/Managing_Plugins#Plugin_Management" target="_blank">Documentation on Managing Plugins</a>') . '</p>
|
|
||||||
<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' );
|
|
||||||
|
|
||||||
$title = __('Plugins');
|
$title = __('Plugins');
|
||||||
$parent_file = 'plugins.php';
|
$parent_file = 'plugins.php';
|
||||||
|
|
||||||
|
@ -143,21 +143,18 @@ wp_enqueue_script( 'wp-ajax-response' );
|
|||||||
wp_enqueue_script( 'jquery-ui-draggable' );
|
wp_enqueue_script( 'jquery-ui-draggable' );
|
||||||
wp_enqueue_script( 'media' );
|
wp_enqueue_script( 'media' );
|
||||||
|
|
||||||
$current_screen->add_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) );
|
add_screen_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
add_contextual_help( $current_screen,
|
||||||
'<p>test</p>'
|
'<p>' . __( 'All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the <em>Screen Options</em> tab to customize the display of this screen.' ) . '</p>' .
|
||||||
|
'<p>' . __( 'You can narrow the list by file type/status using the text link filters at the top of the screen. You also can refine the list by date using the dropdown menu above the media table.' ) . '</p>' .
|
||||||
|
'<p>' . __( 'Hovering over a row reveals action links: <em>Edit</em>, <em>Delete Permanently</em>, and <em>View</em>. Clicking <em>Edit</em> or on the media file’s name displays a simple screen to edit that individual file’s metadata. Clicking <em>Delete Permanently</em> will delete the file from the media library (as well as from any posts to which it is currently attached). <em>View</em> will take you to the display page for that file.' ) . '</p>' .
|
||||||
|
'<p>' . __( 'If a media file has not been attached to any post, you will see that in the <em>Attached To</em> column, and can click on <em>Attach File</em> to launch a small popup that will allow you to search for a post and attach the file.' ) . '</p>' .
|
||||||
|
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||||
|
'<p>' . __( '<a href="http://codex.wordpress.org/Media_Library_Screen" target="_blank">Documentation on Media Library</a>' ) . '</p>' .
|
||||||
|
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
|
||||||
);
|
);
|
||||||
|
|
||||||
add_contextual_help( $current_screen, '
|
|
||||||
<p>' . __( 'All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the <em>Screen Options</em> tab to customize the display of this screen.' ) . '</p>
|
|
||||||
<p>' . __( 'You can narrow the list by file type/status using the text link filters at the top of the screen. You also can refine the list by date using the dropdown menu above the media table.' ) . '</p>
|
|
||||||
<p>' . __( 'Hovering over a row reveals action links: <em>Edit</em>, <em>Delete Permanently</em>, and <em>View</em>. Clicking <em>Edit</em> or on the media file’s name displays a simple screen to edit that individual file’s metadata. Clicking <em>Delete Permanently</em> will delete the file from the media library (as well as from any posts to which it is currently attached). <em>View</em> will take you to the display page for that file.' ) . '</p>
|
|
||||||
<p>' . __( 'If a media file has not been attached to any post, you will see that in the <em>Attached To</em> column, and can click on <em>Attach File</em> to launch a small popup that will allow you to search for a post and attach the file.' ) . '</p>
|
|
||||||
<p><strong>' . __( 'For more information:' ) . '</strong></p>
|
|
||||||
<p>' . __( '<a href="http://codex.wordpress.org/Media_Library_Screen" target="_blank">Documentation on Media Library</a>' ) . '</p>
|
|
||||||
<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' );
|
|
||||||
|
|
||||||
require_once('./admin-header.php');
|
require_once('./admin-header.php');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -17,21 +17,19 @@ $pagenum = $wp_list_table->get_pagenum();
|
|||||||
$title = __('Users');
|
$title = __('Users');
|
||||||
$parent_file = 'users.php';
|
$parent_file = 'users.php';
|
||||||
|
|
||||||
$current_screen->add_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) );
|
add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) );
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
// contextual help - choose Help on the top right of admin panel to preview this.
|
||||||
'<p>test</p>'
|
add_contextual_help($current_screen,
|
||||||
|
'<p>' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.') . '</p>' .
|
||||||
|
'<p>' . __('You can customize the display of information on this screen as you can on other screens, by using the Screen Options tab and the on-screen filters.') . '</p>' .
|
||||||
|
'<p>' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '</p>' .
|
||||||
|
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||||
|
'<p>' . __('<a href="http://codex.wordpress.org/Users_Screen" target="_blank">Documentation on Managing Users</a>') . '</p>' .
|
||||||
|
'<p>' . __('<a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Descriptions of Roles and Capabilities</a>') . '</p>' .
|
||||||
|
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||||
);
|
);
|
||||||
|
|
||||||
add_contextual_help( $current_screen, '
|
|
||||||
<p>' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.') . '</p>
|
|
||||||
<p>' . __('You can customize the display of information on this screen as you can on other screens, by using the Screen Options tab and the on-screen filters.') . '</p>
|
|
||||||
<p>' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '</p>
|
|
||||||
<p><strong>' . __('For more information:') . '</strong></p>
|
|
||||||
<p>' . __('<a href="http://codex.wordpress.org/Users_Screen" target="_blank">Documentation on Managing Users</a>') . '</p>
|
|
||||||
<p>' . __('<a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Descriptions of Roles and Capabilities</a>') . '</p>
|
|
||||||
<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' );
|
|
||||||
|
|
||||||
if ( empty($_REQUEST) ) {
|
if ( empty($_REQUEST) ) {
|
||||||
$referer = '<input type="hidden" name="wp_http_referer" value="'. esc_attr(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
|
$referer = '<input type="hidden" name="wp_http_referer" value="'. esc_attr(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
|
||||||
} elseif ( isset($_REQUEST['wp_http_referer']) ) {
|
} elseif ( isset($_REQUEST['wp_http_referer']) ) {
|
||||||
|
@ -35,20 +35,18 @@ do_action( 'sidebar_admin_setup' );
|
|||||||
$title = __( 'Widgets' );
|
$title = __( 'Widgets' );
|
||||||
$parent_file = 'themes.php';
|
$parent_file = 'themes.php';
|
||||||
|
|
||||||
$current_screen->add_option_context(
|
$help = '
|
||||||
'<p>test</p>'
|
<p>' . __('Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.') . '</p>
|
||||||
);
|
<p>' . __('The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.') . '</p>
|
||||||
|
<p>' . __('If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.') . '</p>
|
||||||
add_contextual_help( $current_screen, '
|
<p>' . __('Widgets may be used multiple times. You can give each widget a title, to display on your site, but it’s not required.') . '</p>
|
||||||
<p>' . __('Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.') . '</p>
|
<p>' . __('Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.') . '</p>
|
||||||
<p>' . __('The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.') . '</p>
|
<p>' . __('Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.') . '</p>
|
||||||
<p>' . __('If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.') . '</p>
|
';
|
||||||
<p>' . __('Widgets may be used multiple times. You can give each widget a title, to display on your site, but it’s not required.') . '</p>
|
$help .= '<p><strong>' . __('For more information:') . '</strong></p>';
|
||||||
<p>' . __('Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.') . '</p>
|
$help .= '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_Screen" target="_blank">Documentation on Widgets</a>') . '</p>';
|
||||||
<p>' . __('Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.') . '</p>
|
$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
|
||||||
<p><strong>' . __('For more information:') . '</strong></p>
|
add_contextual_help($current_screen, $help);
|
||||||
<p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_Screen" target="_blank">Documentation on Widgets</a>') . '</p>
|
|
||||||
<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' );
|
|
||||||
|
|
||||||
// These are the widgets grouped by sidebar
|
// These are the widgets grouped by sidebar
|
||||||
$sidebars_widgets = wp_get_sidebars_widgets();
|
$sidebars_widgets = wp_get_sidebars_widgets();
|
||||||
|
Loading…
Reference in New Issue
Block a user