mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-23 16:51:32 +01:00
Tooltips for 3.6 features: Revisions, Post Locking.
Props siobhan. See #24832 for trunk. git-svn-id: http://core.svn.wordpress.org/trunk@24853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8637a08836
commit
8abd5bb815
@ -1734,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',
|
||||
@ -1751,6 +1752,8 @@ final class WP_Internal_Pointers {
|
||||
'wp340_customize_current_theme_link' => array( 'edit_theme_options' ),
|
||||
'wp340_choose_image_from_library' => array( 'edit_theme_options' ),
|
||||
'wp350_media' => array( 'upload_files' ),
|
||||
'wp360_revisions' => array( 'edit_posts' ),
|
||||
'wp360_locks' => array( 'read' ),
|
||||
);
|
||||
|
||||
// Get dismissed pointers
|
||||
@ -1900,13 +1903,36 @@ final class WP_Internal_Pointers {
|
||||
) );
|
||||
}
|
||||
|
||||
public static function pointer_wp360_revisions() {
|
||||
$content = '<h3>' . __( 'Compare Revisions' ) . '</h3>';
|
||||
$content .= '<p>' . __( 'View, compare, and restore other versions of this content on the improved revisions screen.' ) . '</p>';
|
||||
|
||||
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 = '<h3>' . __( 'Edit Lock' ) . '</h3>';
|
||||
$content .= '<p>' . __( 'Someone else is editing this. No need to refresh; the lock will disappear when they’re done.' ) . '</p>';
|
||||
|
||||
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' );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user