Changeset 20774
- Timestamp:
- 05/11/2012 08:29:08 PM (13 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r20710 r20774 1708 1708 'post-new.php' => 'wp330_media_uploader', 1709 1709 'post.php' => 'wp330_media_uploader', 1710 'themes.php' => 'wp330_saving_widgets',1710 'themes.php' => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ), 1711 1711 ); 1712 1712 … … 1715 1715 return; 1716 1716 1717 $pointer =$registered_pointers[ $hook_suffix ];1717 $pointers = (array) $registered_pointers[ $hook_suffix ]; 1718 1718 1719 1719 $caps_required = array( 1720 1720 'wp330_media_uploader' => array( 'upload_files' ), 1721 1721 'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ), 1722 'wp340_customize_current_theme_link' => array( 'edit_theme_options' ), 1722 1723 ); 1723 1724 if ( isset( $caps_required[ $pointer ] ) ) {1725 foreach ( $caps_required[ $pointer ] as $cap ) {1726 if ( ! current_user_can( $cap ) )1727 return;1728 }1729 }1730 1724 1731 1725 // Get dismissed pointers 1732 1726 $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ); 1733 1727 1734 // Pointer has been dismissed 1735 if ( in_array( $pointer, $dismissed ) ) 1728 $got_pointers = false; 1729 foreach ( array_diff( $pointers, $dismissed ) as $pointer ) { 1730 if ( isset( $caps_required[ $pointer ] ) ) { 1731 foreach ( $caps_required[ $pointer ] as $cap ) { 1732 if ( ! current_user_can( $cap ) ) 1733 continue 2; 1734 } 1735 } 1736 1737 // Bind pointer print function 1738 add_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_' . $pointer ) ); 1739 $got_pointers = true; 1740 } 1741 1742 if ( ! $got_pointers ) 1736 1743 return; 1737 1738 // Bind pointer print function1739 add_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_' . $pointer ) );1740 1744 1741 1745 // Add pointers script and style to queue … … 1826 1830 1827 1831 /** 1832 * Print 'New Feature: Current Theme Customize Link' for 3.4.0. 1833 * 1834 * @since 3.4.0 1835 */ 1836 public static function pointer_wp340_customize_current_theme_link() { 1837 $content = '<h3>' . __( 'New Feature: Customizer' ) . '</h3>'; 1838 $content .= '<p>' . __( 'Click Customize to change the header, background, title and menus of the current theme, all in one place.' ) . '</p>'; 1839 $content .= '<p>' . __( 'Click the Customize links in the Available Themes list below to customize, preview, and optionally activate the selected theme.' ) . '</p>'; 1840 1841 WP_Internal_Pointers::print_js( 'wp340_customize_current_theme_link', '#customize-current-theme-link', array( 1842 'content' => $content, 1843 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left' ), 1844 ) ); 1845 } 1846 1847 /** 1828 1848 * Prevents new users from seeing existing 'new feature' pointers. 1829 1849 * -
trunk/wp-admin/themes.php
r20747 r20774 141 141 142 142 <div class="theme-options"> 143 <a href="<?php echo wp_customize_url( $ct->get_stylesheet() ); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( $customize_title ); ?>"><?php _e( 'Customize' )?></a>143 <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( $customize_title ); ?>"><?php _e( 'Customize' )?></a> 144 144 <span><?php _e( 'Options:' )?></span> 145 145 <?php
Note: See TracChangeset
for help on using the changeset viewer.