diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index bc3cea5e92..f959d36e20 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -117,7 +117,8 @@ $current_screen->set_parentage( $parent_file );
render_screen_meta(); if ( is_network_admin() ) do_action('network_admin_notices'); diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index a9a63478f2..d2a4ed93c1 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -164,12 +164,20 @@ $current_screen->add_option('layout_columns', array('max' => 2, 'default' => 'au if ( 'post' == $post_type ) { $customize_display = '

' . __('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.') . '

'; - $current_screen->add_help_tab( 'customize-display', __('Customizing This Display'), $customize_display ); + $current_screen->add_help_tab( array( + 'id' => 'customize-display', + 'title' => __('Customizing This Display'), + 'content' => $customize_display, + ) ); $title_and_editor = '

' . __('Title - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '

'; $title_and_editor .= '

' . __('Post editor - Enter the text for your post. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The HTML mode allows you to enter raw HTML along with your post text. You can insert media files by clicking the icons above the post editor and following the directions. You can go the distraction-free writing screen, new in 3.2, via the Fullscreen icon in Visual mode (second to last in the top row) or the Fullscreen button in HTML mode (last in the row). Once there, you can make buttons visible by hovering over the top area. Exit Fullscreen back to the regular post editor.') . '

'; - $current_screen->add_help_tab( 'title-post-editor', __('Title and Post Editor'), $title_and_editor ); + $current_screen->add_help_tab( array( + 'id' => 'title-post-editor', + 'title' => __('Title and Post Editor'), + 'content' => $title_and_editor, + ) ); $publish_box = '

' . __('Publish - You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.') . '

'; @@ -181,12 +189,18 @@ if ( 'post' == $post_type ) { $publish_box .= '

' . __('Featured Image - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the featured image as a post thumbnail on the home page, a custom header, etc.') . '

'; } - $current_screen->add_help_tab( 'publish-box', __('Publish Box'), $publish_box ); + $current_screen->add_help_tab( array( + 'title' => __('Publish Box'), + 'content' => $publish_box, + ) ); $discussion_settings = '

' . __('Send Trackbacks - Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.') . '

'; $discussion_settings .= '

' . __('Discussion - You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '

'; - $current_screen->add_help_tab( 'discussion-settings', __('Discussion Settings'), $discussion_settings ); + $current_screen->add_help_tab( array( + 'title' => __('Discussion Settings'), + 'content' => $discussion_settings, + ) ); $current_screen->add_help_sidebar( '

' . sprintf(__('You can also create posts with the Press This bookmarklet.'), 'options-writing.php') . '

' . diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index d7417bfa44..f736f3d297 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -897,9 +897,14 @@ class WP_List_Table { * @access private */ function _js_vars() { + $current_screen = get_current_screen(); + $args = array( - 'class' => get_class( $this ), - 'screen' => get_current_screen() + 'class' => get_class( $this ), + 'screen' => array( + 'id' => $current_screen->id, + 'base' => $current_screen->base, + ) ); printf( "\n", json_encode( $args ) ); diff --git a/wp-admin/includes/screen.php b/wp-admin/includes/screen.php index d3720ce665..d36b6891b2 100644 --- a/wp-admin/includes/screen.php +++ b/wp-admin/includes/screen.php @@ -236,202 +236,22 @@ function convert_to_screen( $screen ) { return $screen; } -function screen_meta($screen) { - global $wp_meta_boxes, $_wp_contextual_help, $wp_list_table, $wp_current_screen_options; - - if ( is_string($screen) ) - $screen = convert_to_screen($screen); - - $columns = get_column_headers( $screen ); - $hidden = get_hidden_columns( $screen ); - - $meta_screens = array('index' => 'dashboard'); - - if ( isset($meta_screens[$screen->id]) ) { - $screen->id = $meta_screens[$screen->id]; - $screen->base = $screen->id; - } - - $show_screen = false; - if ( !empty($wp_meta_boxes[$screen->id]) || !empty($columns) ) - $show_screen = true; - - $screen_options = screen_options($screen); - if ( $screen_options ) - $show_screen = true; - - if ( !isset($_wp_contextual_help) ) - $_wp_contextual_help = array(); - - $settings = apply_filters('screen_settings', '', $screen); - - switch ( $screen->id ) { - case 'widgets': - $settings = '

' . __('Enable accessibility mode') . '' . __('Disable accessibility mode') . "

\n"; - $show_screen = true; - break; - } - if ( ! empty( $settings ) ) - $show_screen = true; - - if ( !empty($wp_current_screen_options) ) - $show_screen = true; - - $show_screen = apply_filters('screen_options_show_screen', $show_screen, $screen); - - // If we have screen options, add the menu to the admin bar. - if ( $show_screen ) - add_action( 'admin_bar_menu', 'wp_admin_bar_screen_options_menu', 80 ); - - -?> -
- - - - - - -
render_screen_meta(); } /** - * Add contextual help text for a page + * Add contextual help text for a page. * - * The array $help takes the following format: - * array( 'contextual-help-tabs' => array( $tab1_title => $tab1_value [, $tab2_title => $tab2_value, ...] ), - * 'contextual-help-sidebar' => $help_links_as_string ) - * - * For backwards compatability, a string is also accepted. + * 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 array|string $help Creates tabs & links columns within help text in array. + * @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; @@ -445,41 +265,22 @@ function add_contextual_help($screen, $help) { $_wp_contextual_help[$screen->id] = $help; } +/** + * Returns the screen layout options. + * + * @todo: deprecate? + */ function screen_layout($screen) { - global $screen_layout_columns, $wp_current_screen_options; + $current_screen = get_current_screen(); - if ( is_string($screen) ) - $screen = convert_to_screen($screen); - - // Back compat for plugins using the filter instead of add_screen_option() - $columns = apply_filters('screen_layout_columns', array(), $screen->id, $screen); - if ( !empty($columns) && isset($columns[$screen->id]) ) - add_screen_option('layout_columns', array('max' => $columns[$screen->id]) ); - - if ( !isset($wp_current_screen_options['layout_columns']) ) { - $screen_layout_columns = 0; + if ( ! $current_screen ) return ''; - } - $screen_layout_columns = get_user_option("screen_layout_$screen->id"); - $num = $wp_current_screen_options['layout_columns']['max']; + ob_start(); + $current_screen->render_screen_layout(); + $screen_layout = ob_get_clean(); - if ( ! $screen_layout_columns ) { - if ( isset($wp_current_screen_options['layout_columns']['default']) ) - $screen_layout_columns = $wp_current_screen_options['layout_columns']['default']; - else - $screen_layout_columns = 'auto'; - } - - $i = 1; - $return = '
' . __('Screen Layout') . "
\n
" . __('Number of Columns:') . "\n"; - while ( $i <= $num ) { - $return .= "\n"; - ++$i; - } - $return .= "\n"; - $return .= "
\n"; - return $return; + return $screen_layout; } /** @@ -492,57 +293,31 @@ function screen_layout($screen) { * @return void */ function add_screen_option( $option, $args = array() ) { - global $wp_current_screen_options; + $current_screen = get_current_screen(); - if ( !isset($wp_current_screen_options) ) - $wp_current_screen_options = array(); + if ( ! $current_screen ) + return; - $wp_current_screen_options[$option] = $args; + return $current_screen->add_option( $option, $args ); } + +/** + * Returns the screen's per-page options. + * + * @todo: deprecate? + */ function screen_options($screen) { - global $wp_current_screen_options; + $current_screen = get_current_screen(); - if ( is_string($screen) ) - $screen = convert_to_screen($screen); - - if ( !isset($wp_current_screen_options['per_page']) ) + if ( ! $current_screen ) return ''; - $per_page_label = $wp_current_screen_options['per_page']['label']; + ob_start(); + $current_screen->render_per_page_options(); + $per_page_options = ob_get_clean(); - if ( empty($wp_current_screen_options['per_page']['option']) ) { - $option = str_replace( '-', '_', "{$screen->id}_per_page" ); - } else { - $option = $wp_current_screen_options['per_page']['option']; - } - - $per_page = (int) get_user_option( $option ); - if ( empty( $per_page ) || $per_page < 1 ) { - if ( isset($wp_current_screen_options['per_page']['default']) ) - $per_page = $wp_current_screen_options['per_page']['default']; - else - $per_page = 20; - } - - if ( 'edit_comments_per_page' == $option ) - $per_page = apply_filters( 'comments_per_page', $per_page, isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all' ); - elseif ( 'categories_per_page' == $option ) - $per_page = apply_filters( 'edit_categories_per_page', $per_page ); - else - $per_page = apply_filters( $option, $per_page ); - - // Back compat - if ( isset( $screen->post_type ) ) - $per_page = apply_filters( 'edit_posts_per_page', $per_page, $screen->post_type ); - - $return = "
\n"; - if ( !empty($per_page_label) ) - $return .= " \n"; - $return .= get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false ); - $return .= ""; - $return .= "
\n"; - return $return; + return $per_page_options; } function screen_icon( $screen = '' ) { @@ -706,6 +481,52 @@ final class WP_Screen { */ public $taxonomy; + /** + * The help tab data associated with the screen, if any. + * + * @since 3.3.0 + * @var array + * @access private + */ + public $help_tabs = array(); + + /** + * The help sidebar data associated with the screen, if any. + * + * @since 3.3.0 + * @var string + * @access private + */ + public $help_sidebar = ''; + + /** + * The screen options associated with the screen, if any. + * + * @since 3.3.0 + * @var array + * @access private + */ + public $options = array(); + + + /** + * Stores the result of the public show_screen_options function. + * + * @since 3.3.0 + * @var bool + * @access private + */ + private $_show_screen_options; + + /** + * Stores the 'screen_settings' section of screen options. + * + * @since 3.3.0 + * @var string + * @access private + */ + private $_screen_settings; + /** * Constructor * @@ -800,7 +621,7 @@ final class WP_Screen { * @param array $args Associative array of arguments particular to the given $option. */ public function add_option( $option, $args = array() ) { - return add_screen_option( $option, $args ); + $this->options[ $option ] = $args; } /** @@ -809,14 +630,31 @@ final class WP_Screen { * * @since 3.3.0 * - * @param string $id Tab ID - * @param string $title Title for the tab - * @param string $content Help tab content in plain text or HTML. + * @param array $args + * - string - title - Title for the tab. + * - string - id - Tab ID. Optional. + * - string - content - Help tab content in plain text or HTML. Optional. + * - callback - callback - A callback to generate the tab content. Optional. + * */ - public function add_help_tab( $id, $title, $content) { - global $_wp_contextual_help; + public function add_help_tab( $args ) { + $defaults = array( + 'title' => false, + 'id' => false, + 'content' => '', + 'callback' => false, + ); + $args = wp_parse_args( $args, $defaults ); - $_wp_contextual_help[$this->id]['tabs'][] = array( $id, $title, $content ); + // Ensure we have a title. + if ( ! $args['title'] ) + 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; } /** @@ -828,8 +666,268 @@ final class WP_Screen { * @param string $content Sidebar content in plain text or HTML. */ public function add_help_sidebar( $content ) { + $this->help_sidebar = $content; + } + + /** + * Render the screen's help section. + * + * This will trigger the deprecated filters for backwards compatibility. + * + * @since 3.3.0 + */ + public function render_screen_meta() { global $_wp_contextual_help; - $_wp_contextual_help[$this->id]['sidebar'] = $content; + // Call old contextual_help_list filter. + if ( ! isset( $_wp_contextual_help ) ) + $_wp_contextual_help = array(); + $_wp_contextual_help = apply_filters( 'contextual_help_list', $_wp_contextual_help, $this ); + + if ( isset( $_wp_contextual_help[ $this->id ] ) ) { + // Call old contextual_help filter. + $contextual_help = apply_filters( 'contextual_help', $_wp_contextual_help[ $this->id ], $this->id, $this ); + + $this->add_help_tab( array( + 'title' => __('Screen Info'), + 'content' => $contextual_help, + ) ); + } + + // Add screen options tab + if ( $this->show_screen_options() ) { + $this->add_help_tab( array( + 'title' => __('Screen Options'), + 'callback' => array( $this, 'render_screen_options' ), + ) ); + } + + // Time to render! + ?> +
+ +
+ _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 = '

' . __('Enable accessibility mode') . '' . __('Disable accessibility mode') . "

\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. + * + * @since 3.3.0 + */ + public function render_screen_options() { + global $wp_meta_boxes, $wp_list_table; + + $columns = get_column_headers( $this ); + $hidden = get_hidden_columns( $this ); + + ?> +
+ id ] ) ) : ?> +
+
+ +
+
+ +
+
+ $title ) { + // Can't hide these for they are special + if ( in_array( $column, $special ) ) + continue; + if ( empty( $title ) ) + continue; + + if ( 'comments' == $column ) + $title = __( 'Comments' ); + $id = "$column-hide"; + echo '\n"; + } + ?> +
+
+ render_screen_layout(); + $this->render_per_page_options(); + echo $this->_screen_settings; + + ?> +
+
+ id, $this ); + + if ( ! empty( $columns ) && isset( $columns[ $this->id ] ) ) + add_screen_option( 'layout_columns', array('max' => $columns[ $this->id ] ) ); + + if ( ! isset( $this->options['layout_columns'] ) ) { + $screen_layout_columns = 0; + return; + } + + $screen_layout_columns = get_user_option("screen_layout_$this->id"); + $num = $this->options['layout_columns']['max']; + + if ( ! $screen_layout_columns ) { + if ( isset( $this->options['layout_columns']['default'] ) ) + $screen_layout_columns = $this->options['layout_columns']['default']; + else + $screen_layout_columns = 'auto'; + } + + ?> +
+
+ + + +
+ options['per_page'] ) ) + return; + + $per_page_label = $this->options['per_page']['label']; + + if ( empty( $this->options['per_page']['option'] ) ) { + $option = str_replace( '-', '_', "{$this->id}_per_page" ); + } else { + $option = $this->options['per_page']['option']; + } + + $per_page = (int) get_user_option( $option ); + if ( empty( $per_page ) || $per_page < 1 ) { + if ( isset($this->options['per_page']['default']) ) + $per_page = $this->options['per_page']['default']; + else + $per_page = 20; + } + + if ( 'edit_comments_per_page' == $option ) { + $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all'; + $per_page = apply_filters( 'comments_per_page', $per_page, $comment_status ); + } elseif ( 'categories_per_page' == $option ) { + $per_page = apply_filters( 'edit_categories_per_page', $per_page ); + } else { + $per_page = apply_filters( $option, $per_page ); + } + + // Back compat + if ( isset( $this->post_type ) ) + $per_page = apply_filters( 'edit_posts_per_page', $per_page, $this->post_type ); + + ?> +
+
+ + + + +
+ ' . __('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.') . '

'; -$current_screen->add_help_tab( 'overview', __('Overview'), $help_overview ); +$current_screen->add_help_tab( array( + 'title' => __('Overview'), + 'content' => $help_overview, +) ); $help_navigation = '

' . __('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.') . '

'; $help_navigation .= '

' . __('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.') . '

'; -$current_screen->add_help_tab( 'navigation', __('Navigation'), $help_navigation ); +$current_screen->add_help_tab( array( + 'title' => __('Navigation'), + 'content' => $help_navigation, +) ); $help_layout = '

' . __('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.') . '

'; $help_layout .= '

' . __('Screen Options - Use the Screen Options tab to choose which Dashboard boxes to show, and how many columns to display.') . '

'; $help_layout .= '

' . __('Drag and Drop - 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.') . '

'; $help_layout .= '

' . __('Box Controls - 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.') . '

'; -$current_screen->add_help_tab( 'layout', __('Layout'), $help_layout ); +$current_screen->add_help_tab( array( + 'title' => __('Layout'), + 'content' => $help_layout, +) ); $help_content = '

' . __('The boxes on your Dashboard screen are:') . '

'; $help_content .= '

' . __('Right Now - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '

'; @@ -56,7 +65,10 @@ $help_content .= '

' . __('WordPress Blog - Latest news from $help_content .= '

' . __('Other WordPress News - Shows the WordPress Planet feed. You can configure it to show a different feed of your choosing.') . '

'; $help_content .= '

' . __('Plugins - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '

'; -$current_screen->add_help_tab( 'content', __('Content'), $help_content ); +$current_screen->add_help_tab( array( + 'title' => __('Content'), + 'content' => $help_content, +) ); $current_screen->add_help_sidebar( '

' . __( 'For more information:' ) . '

' . diff --git a/wp-admin/js/common.dev.js b/wp-admin/js/common.dev.js index 1c77f6c130..9ac5d63ff7 100644 --- a/wp-admin/js/common.dev.js +++ b/wp-admin/js/common.dev.js @@ -266,7 +266,7 @@ $('.contextual-help-tabs').delegate('a', 'click focus', function(e) { panel.addClass('active').show(); // Adjust the height of the help columns - columns = $('#contextual-help-wrap').children('.metabox-prefs').children(); + columns = $('#contextual-help-wrap').children(); columns.height('auto'); height = Math.max.apply( null, $.map( columns, function( el ) { return $(el).height(); }) ); diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js index 51b318beef..e0f69c63ae 100644 --- a/wp-admin/js/common.js +++ b/wp-admin/js/common.js @@ -1 +1 @@ -var showNotice,adminMenu,columns,validateForm,screenMeta,autofold_menu;(function(a){adminMenu={init:function(){var b=a("#adminmenu");this.favorites();a("#collapse-menu",b).click(function(){if(a("body").hasClass("folded")){adminMenu.fold(1);deleteUserSetting("mfold")}else{adminMenu.fold();setUserSetting("mfold","f")}return false});this.flyout(a("#adminmenu li.wp-has-submenu"));this.fold(!a("body").hasClass("folded"))},restoreMenuState:function(){},flyout:function(c,b){if(b){c.unbind();return}c.hoverIntent({over:function(k){var g,d,i,l,j;g=a(this).find(".wp-submenu");d=a(this).offset().top+g.height()+1;i=a("#wpwrap").height();l=60+d-i;j=a(window).height()+a(window).scrollTop()-15;if(j<(d-l)){l=d-j}if(l>1){g.css({marginTop:"-"+l+"px"})}else{if(g.css("marginTop")){g.css({marginTop:""})}}g.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open")},timeout:220,sensitivity:8,interval:100})},toggle:function(){},fold:function(c){var b=a("#adminmenu li.wp-has-current-submenu");a("body").toggleClass("folded",!c);this.flyout(b,c);if(c){b.find(".wp-submenu").css("marginTop","0")}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)}).bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.prop("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()};showNotice={warn:function(){var b=commonL10n.warnDelete||"";if(confirm(b)){return true}return false},note:function(b){alert(b)}};screenMeta={element:null,toggles:null,page:null,padding:null,top:null,map:{"wp-admin-bar-screen-options":"screen-options-wrap","wp-admin-bar-help":"contextual-help-wrap"},init:function(){screenMeta.element=a("#screen-meta");screenMeta.toggles=a(".screen-meta-toggle");screenMeta.page=a("#wpcontent");screenMeta.toggles.click(screenMeta.toggleEvent)},toggleEvent:function(c){var b;c.preventDefault();if(!screenMeta.map[this.id]){return}b=a("#"+screenMeta.map[this.id]);if(b.is(":visible")){screenMeta.close(b,a(this))}else{screenMeta.open(b,a(this))}},open:function(b,c){screenMeta.toggles.filter(".selected").click();c.addClass("selected");screenMeta.padding=parseInt(screenMeta.page.css("paddingTop"),10);screenMeta.top=parseInt(screenMeta.element.css("top"),10);b.show();screenMeta.refresh()},refresh:function(b,c){screenMeta.element.css({top:0});screenMeta.page.css({paddingTop:screenMeta.padding+screenMeta.element.outerHeight()})},close:function(b,c){screenMeta.element.css({top:screenMeta.top});screenMeta.page.css({paddingTop:screenMeta.padding});b.hide();c.removeClass("selected")}};a(".contextual-help-tabs").delegate("a","click focus",function(g){var f=a(this),c,d,b;g.preventDefault();if(f.is(".active a")){return false}a(".contextual-help-tabs .active").removeClass("active");f.parent("li").addClass("active");c=a(f.attr("href"));a(".help-tab-content").not(c).removeClass("active").hide();c.addClass("active").show();d=a("#contextual-help-wrap").children(".metabox-prefs").children();d.height("auto");b=Math.max.apply(null,a.map(d,function(e){return a(e).height()}));d.height(b);screenMeta.refresh()});a(document).ready(function(){var h=false,b,f,e,d,g=a("input.current-page"),c=g.val();a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first"));screenMeta.init();a("tbody").children().children(".check-column").find(":checkbox").click(function(i){if("undefined"==i.shiftKey){return true}if(i.shiftKey){if(!h){return true}b=a(h).closest("form").find(":checkbox");f=b.index(h);e=b.index(this);d=a(this).prop("checked");if(0=0){i=this.scrollTop;k.value=o.substring(0,p).concat("\t",o.substring(j));k.selectionStart=k.selectionEnd=p+1;this.scrollTop=i}}if(n.stopPropagation){n.stopPropagation()}if(n.preventDefault){n.preventDefault()}});a("#newcontent").bind("blur.wpevent_InsertTab",function(i){if(this.lastKey&&9==this.lastKey){this.focus()}});if(g.length){g.closest("form").submit(function(i){if(a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&g.val()==c){g.val("1")}})}a(window).bind("resize.autofold",function(){if(getUserSetting("mfold")=="f"){return}var i=a(window).width();adminMenu.fold(i>=800)}).triggerHandler("resize")});a(document).bind("wp_CloseOnEscape",function(c,b){if(typeof(b.cb)!="function"){return}if(typeof(b.condition)!="function"||b.condition()){b.cb()}return true})})(jQuery); \ No newline at end of file +var showNotice,adminMenu,columns,validateForm,screenMeta,autofold_menu;(function(a){adminMenu={init:function(){var b=a("#adminmenu");this.favorites();a("#collapse-menu",b).click(function(){if(a("body").hasClass("folded")){adminMenu.fold(1);deleteUserSetting("mfold")}else{adminMenu.fold();setUserSetting("mfold","f")}return false});this.flyout(a("#adminmenu li.wp-has-submenu"));this.fold(!a("body").hasClass("folded"))},restoreMenuState:function(){},flyout:function(c,b){if(b){c.unbind();return}c.hoverIntent({over:function(k){var g,d,i,l,j;g=a(this).find(".wp-submenu");d=a(this).offset().top+g.height()+1;i=a("#wpwrap").height();l=60+d-i;j=a(window).height()+a(window).scrollTop()-15;if(j<(d-l)){l=d-j}if(l>1){g.css({marginTop:"-"+l+"px"})}else{if(g.css("marginTop")){g.css({marginTop:""})}}g.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open")},timeout:220,sensitivity:8,interval:100})},toggle:function(){},fold:function(c){var b=a("#adminmenu li.wp-has-current-submenu");a("body").toggleClass("folded",!c);this.flyout(b,c);if(c){b.find(".wp-submenu").css("marginTop","0")}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)}).bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.prop("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()};showNotice={warn:function(){var b=commonL10n.warnDelete||"";if(confirm(b)){return true}return false},note:function(b){alert(b)}};screenMeta={element:null,toggles:null,page:null,padding:null,top:null,map:{"wp-admin-bar-screen-options":"screen-options-wrap","wp-admin-bar-help":"contextual-help-wrap"},init:function(){screenMeta.element=a("#screen-meta");screenMeta.toggles=a(".screen-meta-toggle");screenMeta.page=a("#wpcontent");screenMeta.toggles.click(screenMeta.toggleEvent)},toggleEvent:function(c){var b;c.preventDefault();if(!screenMeta.map[this.id]){return}b=a("#"+screenMeta.map[this.id]);if(b.is(":visible")){screenMeta.close(b,a(this))}else{screenMeta.open(b,a(this))}},open:function(b,c){screenMeta.toggles.filter(".selected").click();c.addClass("selected");screenMeta.padding=parseInt(screenMeta.page.css("paddingTop"),10);screenMeta.top=parseInt(screenMeta.element.css("top"),10);b.show();screenMeta.refresh()},refresh:function(b,c){screenMeta.element.css({top:0});screenMeta.page.css({paddingTop:screenMeta.padding+screenMeta.element.outerHeight()})},close:function(b,c){screenMeta.element.css({top:screenMeta.top});screenMeta.page.css({paddingTop:screenMeta.padding});b.hide();c.removeClass("selected")}};a(".contextual-help-tabs").delegate("a","click focus",function(g){var f=a(this),c,d,b;g.preventDefault();if(f.is(".active a")){return false}a(".contextual-help-tabs .active").removeClass("active");f.parent("li").addClass("active");c=a(f.attr("href"));a(".help-tab-content").not(c).removeClass("active").hide();c.addClass("active").show();d=a("#contextual-help-wrap").children();d.height("auto");b=Math.max.apply(null,a.map(d,function(e){return a(e).height()}));d.height(b);screenMeta.refresh()});a(document).ready(function(){var h=false,b,f,e,d,g=a("input.current-page"),c=g.val();a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first"));screenMeta.init();a("tbody").children().children(".check-column").find(":checkbox").click(function(i){if("undefined"==i.shiftKey){return true}if(i.shiftKey){if(!h){return true}b=a(h).closest("form").find(":checkbox");f=b.index(h);e=b.index(this);d=a(this).prop("checked");if(0=0){i=this.scrollTop;k.value=o.substring(0,p).concat("\t",o.substring(j));k.selectionStart=k.selectionEnd=p+1;this.scrollTop=i}}if(n.stopPropagation){n.stopPropagation()}if(n.preventDefault){n.preventDefault()}});a("#newcontent").bind("blur.wpevent_InsertTab",function(i){if(this.lastKey&&9==this.lastKey){this.focus()}});if(g.length){g.closest("form").submit(function(i){if(a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&g.val()==c){g.val("1")}})}a(window).bind("resize.autofold",function(){if(getUserSetting("mfold")=="f"){return}var i=a(window).width();adminMenu.fold(i>=800)}).triggerHandler("resize")});a(document).bind("wp_CloseOnEscape",function(c,b){if(typeof(b.cb)!="function"){return}if(typeof(b.condition)!="function"||b.condition()){b.cb()}return true})})(jQuery); \ No newline at end of file diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 897d2c740f..e446248680 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -576,22 +576,6 @@ function wp_admin_bar_updates_menu( $wp_admin_bar ) { $wp_admin_bar->add_menu( array( 'id' => 'updates', 'title' => $update_title, 'href' => network_admin_url( 'update-core.php' ) ) ); } -/** - * Add screen options link. - * - * @since 3.3.0 - */ -function wp_admin_bar_screen_options_menu( $wp_admin_bar ) { - $wp_admin_bar->add_menu( array( - 'id' => 'screen-options', - 'title' => __('Screen Options'), - 'href' => '#', - 'meta' => array( - 'class' => 'screen-meta-toggle hide-if-no-js', - ), - ) ); -} - /** * Add help link. * diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 6aa2a5f06e..22a6f17127 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -61,7 +61,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' ); - $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20110927', 1 ); + $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20110930', 1 ); $scripts->add_script_data( 'common', 'commonL10n', array( 'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete.") ) );