Ticket #20554: 20554.diff
File 20554.diff, 4.0 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/template.php
1705 1705 'index.php' => 'wp330_toolbar', 1706 1706 'post-new.php' => 'wp330_media_uploader', 1707 1707 'post.php' => 'wp330_media_uploader', 1708 'themes.php' => 'wp330_saving_widgets',1708 'themes.php' => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ), 1709 1709 ); 1710 1710 1711 1711 // Check if screen related pointer is registered 1712 1712 if ( empty( $registered_pointers[ $hook_suffix ] ) ) 1713 1713 return; 1714 1714 1715 $pointer =$registered_pointers[ $hook_suffix ];1715 $pointers = (array) $registered_pointers[ $hook_suffix ]; 1716 1716 1717 1717 $caps_required = array( 1718 1718 'wp330_media_uploader' => array( 'upload_files' ), 1719 1719 'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ), 1720 'wp340_customize_current_theme_link' => array( 'edit_theme_options' ), 1720 1721 ); 1721 1722 1722 if ( isset( $caps_required[ $pointer ] ) ) { 1723 foreach ( $caps_required[ $pointer ] as $cap ) { 1724 if ( ! current_user_can( $cap ) ) 1725 return; 1723 // Get dismissed pointers 1724 $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ); 1725 1726 $got_pointers = false; 1727 foreach ( $pointers as $pointer ) { 1728 if ( isset( $caps_required[ $pointer ] ) ) { 1729 foreach ( $caps_required[ $pointer ] as $cap ) { 1730 if ( ! current_user_can( $cap ) ) 1731 continue 2; 1732 } 1726 1733 } 1734 1735 // Pointer has been dismissed 1736 if ( in_array( $pointer, $dismissed ) ) 1737 continue; 1738 1739 // Bind pointer print function 1740 add_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_' . $pointer ) ); 1741 $got_pointers = true; 1727 1742 } 1728 1743 1729 // Get dismissed pointers 1730 $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ); 1731 1732 // Pointer has been dismissed 1733 if ( in_array( $pointer, $dismissed ) ) 1744 if ( ! $got_pointers ) 1734 1745 return; 1735 1746 1736 // Bind pointer print function1737 add_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_' . $pointer ) );1738 1739 1747 // Add pointers script and style to queue 1740 1748 wp_enqueue_style( 'wp-pointer' ); 1741 1749 wp_enqueue_script( 'wp-pointer' ); … … 1823 1831 } 1824 1832 1825 1833 /** 1834 * Print 'New Feature: Current Theme Customize Link' for 3.4.0. 1835 * 1836 * @since 3.3.0 1837 */ 1838 public static function pointer_wp340_customize_current_theme_link() { 1839 $content = '<h3>' . __( 'New Feature: Customizer' ) . '</h3>'; 1840 $content .= '<p>' . __( 'Click Customize to change the header, background, title and menus of the current theme, all in one place.' ) . '</p>'; 1841 $content .= '<p>' . __( 'Click the Customize links in the Available Themes list below to customize, preview, and optionally activate the selected theme.' ) . '</p>'; 1842 1843 WP_Internal_Pointers::print_js( 'wp340_customize_current_theme_link', '#customize-current-theme-link', array( 1844 'content' => $content, 1845 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left' ), 1846 ) ); 1847 } 1848 1849 /** 1826 1850 * Prevents new users from seeing existing 'new feature' pointers. 1827 1851 * 1828 1852 * @since 3.3.0 -
wp-admin/themes.php
122 122 </div> 123 123 124 124 <div class="theme-options"> 125 <a href="<?php echo wp_customize_url( $ct->get_stylesheet() ); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( sprintf( __( 'Customize “%s”' ), $ct->display('Name') ) ); ?>"><?php _e( 'Customize' )?></a>125 <a id="customize-current-theme-link" href="<?php echo wp_customize_url( $ct->get_stylesheet() ); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( sprintf( __( 'Customize “%s”' ), $ct->display('Name') ) ); ?>"><?php _e( 'Customize' )?></a> 126 126 <span><?php _e( 'Options:' )?></span> 127 127 <?php 128 128 // Pretend you didn't see this.