From 15afe56aa971351429ec53bc2c585e6c72f41940 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 30 Nov 2011 16:05:59 +0000 Subject: [PATCH] Don't show pointers for new users. Works for new installs, too. fixes #19360. git-svn-id: https://develop.svn.wordpress.org/trunk@19489 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/template.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index ac7a7b8aa5..010c057d16 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1677,9 +1677,6 @@ final class WP_Internal_Pointers { * remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp330_toolbar' ) ); */ public static function enqueue_scripts( $hook_suffix ) { - if ( get_site_option( 'initial_db_version' ) >= 20000 ) // Final db_version for 3.3. - return; - /* * Register feature pointers * Format: array( hook_suffix => pointer_id ) @@ -1805,9 +1802,19 @@ final class WP_Internal_Pointers { 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : '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_media_uploader,wp330_saving_widgets' ); + } } -add_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) ); +add_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) ); +add_action( 'user_register', array( 'WP_Internal_Pointers', 'dismiss_pointers_for_new_users' ) ); /** * Convert a screen string to a screen object