From 97c81c4507c648641cb06db4d1028dff6acdc262 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 26 Nov 2014 02:54:25 +0000 Subject: [PATCH] Editor: add a pointer for the new DFW button. Remove the wp350_media and wp360_revisions pointers from the same screens. See #30458. Built from https://develop.svn.wordpress.org/trunk@30574 git-svn-id: http://core.svn.wordpress.org/trunk@30564 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 46 ++++++++++++++++------------------ wp-includes/version.php | 2 +- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 56417ba571..b75fcf302f 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1905,8 +1905,8 @@ final class WP_Internal_Pointers { */ $registered_pointers = array( - 'post-new.php' => 'wp350_media', - 'post.php' => array( 'wp350_media', 'wp360_revisions' ), + 'post-new.php' => 'wp410_dfw', + 'post.php' => 'wp410_dfw', 'edit.php' => 'wp360_locks', 'widgets.php' => 'wp390_widgets', 'themes.php' => 'wp390_widgets', @@ -1919,7 +1919,6 @@ final class WP_Internal_Pointers { $pointers = (array) $registered_pointers[ $hook_suffix ]; $caps_required = array( - 'wp350_media' => array( 'upload_files' ), 'wp390_widgets' => array( 'edit_theme_options' ), ); @@ -1999,26 +1998,8 @@ final class WP_Internal_Pointers { public static function pointer_wp330_saving_widgets() {} public static function pointer_wp340_customize_current_theme_link() {} public static function pointer_wp340_choose_image_from_library() {} - - public static function pointer_wp350_media() { - $content = '

' . __( 'New Media Manager' ) . '

'; - $content .= '

' . __( 'Uploading files and creating image galleries has a whole new look. Check it out!' ) . '

'; - - self::print_js( 'wp350_media', '.insert-media', array( - 'content' => $content, - 'position' => array( 'edge' => is_rtl() ? 'right' : 'left', 'align' => 'center' ), - ) ); - } - - 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.misc-pub-revisions', array( - 'content' => $content, - 'position' => array( 'edge' => is_rtl() ? 'left' : 'right', 'align' => 'center' ), - ) ); - } + public static function pointer_wp350_media() {} + public static function pointer_wp360_revisions() {} public static function pointer_wp360_locks() { if ( ! is_multi_author() ) { @@ -2060,13 +2041,30 @@ final class WP_Internal_Pointers { ) ); } + public static function pointer_wp410_dfw() { + $content = '

' . __( 'Distraction Free Writing' ) . '

'; + $content .= '

' . __( 'Enable distraction free writing; everything fades away so you can focus. ' + . 'Bring your admin back by moving your mouse, then start typing and it fades away.' ) . '

'; + + if ( is_rtl() ) { + $position = array( 'edge' => 'left', 'align' => 'left', 'my' => 'left-5 top-60' ); + } else { + $position = array( 'edge' => 'right', 'align' => 'right', 'my' => 'right+5 top-60' ); + } + + self::print_js( 'wp410_dfw', '#content-html', array( + 'content' => $content, + 'position' => $position, + ) ); + } + /** * 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', 'wp350_media,wp360_revisions,wp360_locks,wp390_widgets' ); + add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp360_locks,wp390_widgets' ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 35bbacf4d3..af4533b184 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-beta2-30573'; +$wp_version = '4.1-beta2-30574'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.