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
This commit is contained in:
Andrew Nacin 2011-11-30 16:05:59 +00:00
parent 8ef374f2e1
commit 15afe56aa9
1 changed files with 11 additions and 4 deletions

View File

@ -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