Ticket #30458: 30458.2.patch
File 30458.2.patch, 3.1 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/template.php
1891 1891 */ 1892 1892 1893 1893 $registered_pointers = array( 1894 'post-new.php' => 'wp 350_media',1895 'post.php' => array( 'wp350_media', 'wp360_revisions' ),1894 'post-new.php' => 'wp410_dfw', 1895 'post.php' => 'wp410_dfw', 1896 1896 'edit.php' => 'wp360_locks', 1897 1897 'widgets.php' => 'wp390_widgets', 1898 1898 'themes.php' => 'wp390_widgets', … … 1905 1905 $pointers = (array) $registered_pointers[ $hook_suffix ]; 1906 1906 1907 1907 $caps_required = array( 1908 'wp350_media' => array( 'upload_files' ),1909 1908 'wp390_widgets' => array( 'edit_theme_options' ), 1910 1909 ); 1911 1910 … … 1985 1984 public static function pointer_wp330_saving_widgets() {} 1986 1985 public static function pointer_wp340_customize_current_theme_link() {} 1987 1986 public static function pointer_wp340_choose_image_from_library() {} 1987 public static function pointer_wp350_media() {} 1988 public static function pointer_wp360_revisions() {} 1988 1989 1989 public static function pointer_wp350_media() {1990 $content = '<h3>' . __( 'New Media Manager' ) . '</h3>';1991 $content .= '<p>' . __( 'Uploading files and creating image galleries has a whole new look. Check it out!' ) . '</p>';1992 1993 self::print_js( 'wp350_media', '.insert-media', array(1994 'content' => $content,1995 'position' => array( 'edge' => is_rtl() ? 'right' : 'left', 'align' => 'center' ),1996 ) );1997 }1998 1999 public static function pointer_wp360_revisions() {2000 $content = '<h3>' . __( 'Compare Revisions' ) . '</h3>';2001 $content .= '<p>' . __( 'View, compare, and restore other versions of this content on the improved revisions screen.' ) . '</p>';2002 2003 self::print_js( 'wp360_revisions', '.misc-pub-section.misc-pub-revisions', array(2004 'content' => $content,2005 'position' => array( 'edge' => is_rtl() ? 'left' : 'right', 'align' => 'center' ),2006 ) );2007 }2008 2009 1990 public static function pointer_wp360_locks() { 2010 1991 if ( ! is_multi_author() ) { 2011 1992 return; … … 2046 2027 ) ); 2047 2028 } 2048 2029 2030 public static function pointer_wp410_dfw() { 2031 $content = '<h3>' . __( 'Distraction Free Writing' ) . '</h3>'; 2032 $content .= '<p>' . __( 'Enable distraction free writing; everything fades away so you can focus. ' 2033 . 'Bring your admin back by moving your mouse, then start typing and it fades away.' ) . '</p>'; 2034 2035 if ( is_rtl() ) { 2036 $position = array( 'edge' => 'left', 'align' => 'left', 'my' => 'left-5 top-60' ); 2037 } else { 2038 $position = array( 'edge' => 'right', 'align' => 'right', 'my' => 'right+5 top-60' ); 2039 } 2040 2041 self::print_js( 'wp410_dfw', '#content-html', array( 2042 'content' => $content, 2043 'position' => $position, 2044 ) ); 2045 } 2046 2049 2047 /** 2050 2048 * Prevents new users from seeing existing 'new feature' pointers. 2051 2049 * … … 2052 2050 * @since 3.3.0 2053 2051 */ 2054 2052 public static function dismiss_pointers_for_new_users( $user_id ) { 2055 add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp3 50_media,wp360_revisions,wp360_locks,wp390_widgets' );2053 add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp360_locks,wp390_widgets' ); 2056 2054 } 2057 2055 } 2058 2056