' . "\n";
if ( 'dashboard_browser_nag' != $box['id'] )
@@ -968,6 +966,79 @@ function remove_meta_box($id, $screen, $context) {
$wp_meta_boxes[$page][$context][$priority][$id] = false;
}
+/**
+ * Meta Box Accordion Template Function
+ *
+ * Largely made up of abstracted code from {@link do_meta_boxes()}, this
+ * function serves to build meta boxes as list items for display as
+ * a collapsible accordion.
+ *
+ * @since 3.6.0
+ *
+ * @uses global $wp_meta_boxes Used to retrieve registered meta boxes.
+ *
+ * @param string|object $screen The screen identifier.
+ * @param string $context The meta box context.
+ * @param mixed $object gets passed to the section callback function as first parameter.
+ * @return int number of meta boxes as accordion sections.
+ */
+function do_accordion_sections( $screen, $context, $object ) {
+ global $wp_meta_boxes;
+
+ wp_enqueue_script( 'accordion' );
+
+ if ( empty( $screen ) )
+ $screen = get_current_screen();
+ elseif ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
+
+ $page = $screen->id;
+
+ $hidden = get_hidden_meta_boxes( $screen );
+ ?>
+
+ ',
- 'uid': 'ID; ?>',
- 'time':''
- },
- ajaxurl = '',
+var ajaxurl = '',
pagenow = 'id; ?>',
typenow = 'post_type; ?>',
adminpage = '',
@@ -1440,7 +1506,7 @@ function _post_states($post) {
if ( is_sticky($post->ID) )
$post_states['sticky'] = __('Sticky');
- $post_states = apply_filters( 'display_post_states', $post_states );
+ $post_states = apply_filters( 'display_post_states', $post_states, $post );
if ( ! empty($post_states) ) {
$state_count = count($post_states);
@@ -1453,8 +1519,6 @@ function _post_states($post) {
}
}
- if ( get_post_format( $post->ID ) )
- echo ' -
' . get_post_format_string( get_post_format( $post->ID ) ) . '';
}
function _media_states( $post ) {
@@ -1670,7 +1734,8 @@ final class WP_Internal_Pointers {
$registered_pointers = array(
'index.php' => 'wp330_toolbar',
'post-new.php' => 'wp350_media',
- 'post.php' => 'wp350_media',
+ 'post.php' => array( 'wp350_media', 'wp360_revisions' ),
+ 'edit.php' => 'wp360_locks',
'themes.php' => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ),
'appearance_page_custom-header' => 'wp340_choose_image_from_library',
'appearance_page_custom-background' => 'wp340_choose_image_from_library',
@@ -1836,13 +1901,36 @@ final class WP_Internal_Pointers {
) );
}
+ public static function pointer_wp360_revisions() {
+ $content = '
' . __( 'Compare Revisions' ) . '
';
+ $content .= '
' . __( 'View, compare, and restore other versions of this content on the improved revisions screen.' ) . '
';
+
+ self::print_js( 'wp360_revisions', '.misc-pub-section.num-revisions', array(
+ 'content' => $content,
+ 'position' => array( 'edge' => is_rtl() ? 'left' : 'right', 'align' => 'center', 'my' => is_rtl() ? 'left' : 'right-14px' ),
+ ) );
+ }
+
+ public static function pointer_wp360_locks() {
+ $content = '
' . __( 'Edit Lock' ) . '
';
+ $content .= '
' . __( 'Someone else is editing this. No need to refresh; the lock will disappear when they’re done.' ) . '
';
+
+ if ( ! is_multi_author() )
+ return;
+
+ self::print_js( 'wp360_locks', 'tr.wp-locked .locked-indicator', array(
+ 'content' => $content,
+ 'position' => array( 'edge' => 'left', 'align' => 'left' ),
+ ) );
+ }
+
/**
* Prevents new users from seeing existing 'new feature' pointers.
*
* @since 3.3.0
*/
public static function dismiss_pointers_for_new_users( $user_id ) {
- add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp330_toolbar,wp330_saving_widgets,wp340_choose_image_from_library,wp340_customize_current_theme_link,wp350_media' );
+ add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp330_toolbar,wp330_saving_widgets,wp340_choose_image_from_library,wp340_customize_current_theme_link,wp350_media,wp360_revisions,wp360_locks' );
}
}
@@ -1865,3 +1953,24 @@ function convert_to_screen( $hook_name ) {
return WP_Screen::get( $hook_name );
}
+
+/**
+ * Output the HTML for restoring the post data from DOM storage
+ *
+ * @since 3.6
+ * @access private
+ */
+function _local_storage_notice() {
+ ?>
+
+