Changeset 28090
- Timestamp:
- 04/12/2014 08:47:12 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/template.php
r27776 r28090 1830 1830 * remove_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) ); 1831 1831 * 1832 * Individual pointers (e.g. wp3 30_toolbar) can be disabled using the following:1833 * remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp3 30_toolbar' ) );1832 * Individual pointers (e.g. wp390_widgets) can be disabled using the following: 1833 * remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp390_widgets' ) ); 1834 1834 */ 1835 1835 public static function enqueue_scripts( $hook_suffix ) { … … 1840 1840 1841 1841 $registered_pointers = array( 1842 'index.php' => 'wp330_toolbar',1843 1842 'post-new.php' => 'wp350_media', 1844 1843 'post.php' => array( 'wp350_media', 'wp360_revisions' ), 1845 1844 'edit.php' => 'wp360_locks', 1846 'themes.php' => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ), 1847 'appearance_page_custom-header' => 'wp340_choose_image_from_library', 1848 'appearance_page_custom-background' => 'wp340_choose_image_from_library', 1845 'widgets.php' => 'wp390_widgets', 1846 'themes.php' => 'wp390_widgets', 1849 1847 ); 1850 1848 … … 1856 1854 1857 1855 $caps_required = array( 1858 'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ),1859 'wp340_customize_current_theme_link' => array( 'edit_theme_options' ),1860 'wp340_choose_image_from_library' => array( 'edit_theme_options' ),1861 1856 'wp350_media' => array( 'upload_files' ), 1862 1857 ); … … 1933 1928 } 1934 1929 1935 public static function pointer_wp330_toolbar() { 1936 $content = '<h3>' . __( 'New Feature: Toolbar' ) . '</h3>'; 1937 $content .= '<p>' . __( 'We’ve combined the admin bar and the old Dashboard header into one persistent toolbar. Hover over the toolbar items to see what’s new.' ) . '</p>'; 1938 1939 if ( is_multisite() && is_super_admin() ) 1940 $content .= '<p>' . __( 'Network Admin is now located in the My Sites menu.' ) . '</p>'; 1941 1942 WP_Internal_Pointers::print_js( 'wp330_toolbar', '#wpadminbar', array( 1943 'content' => $content, 1944 'position' => array( 'edge' => 'top', 'align' => 'center' ), 1945 ) ); 1946 } 1947 1948 /** 1949 * Print 'Updated Media Uploader' for 3.3.0. 1950 * 1951 * @since 3.3.0 1952 */ 1930 public static function pointer_wp330_toolbar() {} 1953 1931 public static function pointer_wp330_media_uploader() {} 1954 1955 /** 1956 * Print 'New Feature: Saving Widgets' for 3.3.0. 1957 * 1958 * @since 3.3.0 1959 */ 1960 public static function pointer_wp330_saving_widgets() { 1961 $content = '<h3>' . __( 'New Feature: Saving Widgets' ) . '</h3>'; 1962 $content .= '<p>' . __( 'If you change your mind and revert to your previous theme, we’ll put the widgets back the way you had them.' ) . '</p>'; 1963 1964 WP_Internal_Pointers::print_js( 'wp330_saving_widgets', '#message2', array( 1965 'content' => $content, 1966 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left' ), 1967 ) ); 1968 } 1969 1970 /** 1971 * Print 'New Feature: Current Theme Customize Link' for 3.4.0. 1972 * 1973 * @since 3.4.0 1974 */ 1975 public static function pointer_wp340_customize_current_theme_link() { 1976 $content = '<h3>' . __( 'New Feature: Customizer' ) . '</h3>'; 1977 $content .= '<p>' . __( 'Click Customize to change the header, background, title and menus of the current theme, all in one place.' ) . '</p>'; 1978 $content .= '<p>' . __( 'Click the Live Preview links in the Available Themes list below to customize and preview another theme before activating it.' ) . '</p>'; 1979 1980 WP_Internal_Pointers::print_js( 'wp340_customize_current_theme_link', '#customize-current-theme-link', array( 1981 'content' => $content, 1982 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left', 'offset' => is_rtl() ? '32 0' : '-32 0' ), 1983 ) ); 1984 } 1985 1986 /** 1987 * Print 'New Feature: Choose Image from Library' for 3.4.0. 1988 * 1989 * @since 3.4.0 1990 */ 1991 public static function pointer_wp340_choose_image_from_library() { 1992 $content = '<h3>' . __( 'New Feature: Choose Image from Library' ) . '</h3>'; 1993 $content .= '<p>' . __( 'Want to use an image you uploaded earlier? Select it from your media library instead of uploading it again.' ) . '</p>'; 1994 1995 WP_Internal_Pointers::print_js( 'wp340_choose_image_from_library', '#choose-from-library-link', array( 1996 'content' => $content, 1997 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left', 'defer_loading' => true ), 1998 ) ); 1999 } 1932 public static function pointer_wp330_saving_widgets() {} 1933 public static function pointer_wp340_customize_current_theme_link() {} 1934 public static function pointer_wp340_choose_image_from_library() {} 2000 1935 2001 1936 public static function pointer_wp350_media() { … … 2020 1955 2021 1956 public static function pointer_wp360_locks() { 1957 if ( ! is_multi_author() ) { 1958 return; 1959 } 1960 2022 1961 $content = '<h3>' . __( 'Edit Lock' ) . '</h3>'; 2023 1962 $content .= '<p>' . __( 'Someone else is editing this. No need to refresh; the lock will disappear when they’re done.' ) . '</p>'; 2024 2025 if ( ! is_multi_author() )2026 return;2027 1963 2028 1964 self::print_js( 'wp360_locks', 'tr.wp-locked .locked-indicator', array( … … 2032 1968 } 2033 1969 1970 public static function pointer_wp390_widgets() { 1971 if ( ! current_theme_supports( 'widgets' ) ) { 1972 return; 1973 } 1974 1975 $content = '<h3>' . __( 'New Feature: Live Widget Previews' ) . '</h3>'; 1976 $content .= '<p>' . __( 'Add, edit, and play around with your widgets from the theme customizer.' ) . ' ' . __( 'Preview your changes in real-time and only save them when you’re ready.' ) . '</p>'; 1977 1978 if ( 'themes' === get_current_screen()->id ) { 1979 $selector = '.theme.active .customize'; 1980 $position = array( 'edge' => is_rtl() ? 'right' : 'left', 'align' => 'center' ); 1981 } else { 1982 $selector = 'a[href="customize.php"]'; 1983 if ( is_rtl() ) { 1984 $position = array( 'edge' => 'right', 'align' => 'center-8px', 'my' => 'right-5px' ); 1985 } else { 1986 $position = array( 'edge' => 'left', 'align' => 'center-8px', 'my' => 'left-5px' ); 1987 } 1988 } 1989 1990 self::print_js( 'wp390_widgets', $selector, array( 1991 'content' => $content, 1992 'position' => $position, 1993 ) ); 1994 } 1995 2034 1996 /** 2035 1997 * Prevents new users from seeing existing 'new feature' pointers. … … 2038 2000 */ 2039 2001 public static function dismiss_pointers_for_new_users( $user_id ) { 2040 add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp3 30_toolbar,wp330_saving_widgets,wp340_choose_image_from_library,wp340_customize_current_theme_link,wp350_media,wp360_revisions,wp360_locks' );2002 add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp350_media,wp360_revisions,wp360_locks,wp390_widgets' ); 2041 2003 } 2042 2004 }
Note: See TracChangeset
for help on using the changeset viewer.