Ticket #22454: 22454.diff
File 22454.diff, 3.4 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/template.php
1679 1679 1680 1680 $registered_pointers = array( 1681 1681 'index.php' => 'wp330_toolbar', 1682 'post-new.php' => 'wp330_media_uploader',1683 'post.php' => 'wp330_media_uploader',1682 'post-new.php' => array( 'wp350_media' ), 1683 'post.php' => array( 'wp350_media' ), 1684 1684 'themes.php' => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ), 1685 1685 'appearance_page_custom-header' => 'wp340_choose_image_from_library', 1686 1686 'appearance_page_custom-background' => 'wp340_choose_image_from_library', 1687 'plugin-install.php' => array( 'wp350_favorites' ), 1687 1688 ); 1688 1689 1689 1690 // Check if screen related pointer is registered … … 1693 1694 $pointers = (array) $registered_pointers[ $hook_suffix ]; 1694 1695 1695 1696 $caps_required = array( 1696 'wp330_media_uploader' => array( 'upload_files' ),1697 1697 'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ), 1698 1698 'wp340_customize_current_theme_link' => array( 'edit_theme_options' ), 1699 1699 'wp340_choose_image_from_library' => array( 'edit_theme_options' ), 1700 'wp350_media' => array( 'upload_files' ), 1700 1701 ); 1701 1702 1702 1703 // Get dismissed pointers … … 1788 1789 * 1789 1790 * @since 3.3.0 1790 1791 */ 1791 public static function pointer_wp330_media_uploader() { 1792 $content = '<h3>' . __( 'Updated Media Uploader' ) . '</h3>'; 1793 $content .= '<p>' . __( 'The single media icon now launches the uploader for all file types, and the new drag and drop interface makes uploading a breeze.' ) . '</p>'; 1792 public static function pointer_wp330_media_uploader() {} 1794 1793 1795 WP_Internal_Pointers::print_js( 'wp330_media_uploader', '#content-add_media', array(1796 'content' => $content,1797 'position' => array( 'edge' => is_rtl() ? 'right' : 'left', 'align' => 'center' ),1798 ) );1799 }1800 1801 1794 /** 1802 1795 * Print 'New Feature: Saving Widgets' for 3.3.0. 1803 1796 * … … 1844 1837 ) ); 1845 1838 } 1846 1839 1840 public static function pointer_wp350_media() { 1841 $content = '<h3>' . __( 'New Media Uploader' ) . '</h3>'; 1842 $content .= '<p>' . __( 'Working with images and other files has never been easier.' ) . '</p>'; 1843 1844 self::print_js( 'wp350_media', '.insert-media', array( 1845 'content' => $content, 1846 'position' => array( 'edge' => is_rtl() ? 'right' : 'left', 'align' => 'center' ), 1847 ) ); 1848 } 1849 1850 public static function pointer_wp350_favorites() { 1851 $content = '<h3>' . __( 'New Feature: Plugin Favorites' ) . '</h3>'; 1852 $content .= '<p>' . __( 'If you have logged into WordPress.org and favorited plugins there, you can now install them directly from this tab.' ) . '</p>'; 1853 1854 self::print_js( 'wp350_favorites', '.plugin-install-favorites', array( 1855 'content' => $content, 1856 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left', 'offset' => is_rtl() ? '40 0' : '-40 0' ), 1857 ) ); 1858 } 1859 1847 1860 /** 1848 1861 * Prevents new users from seeing existing 'new feature' pointers. 1849 1862 * 1850 1863 * @since 3.3.0 1851 1864 */ 1852 1865 public static function dismiss_pointers_for_new_users( $user_id ) { 1853 add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp330_toolbar,wp330_ media_uploader,wp330_saving_widgets,wp340_choose_image_from_library,wp340_customize_current_theme_link' );1866 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,wp350_favorites' ); 1854 1867 } 1855 1868 } 1856 1869