diff --git wp-admin/includes/template.php wp-admin/includes/template.php
index 1c43103..a1a496a 100644
|
|
|
final class WP_Internal_Pointers {
|
| 1707 | 1707 | 'index.php' => 'wp330_toolbar', |
| 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 | |
| 1713 | 1713 | // Check if screen related pointer is registered |
| 1714 | 1714 | if ( empty( $registered_pointers[ $hook_suffix ] ) ) |
| 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 | |
| 1724 | | if ( isset( $caps_required[ $pointer ] ) ) { |
| 1725 | | foreach ( $caps_required[ $pointer ] as $cap ) { |
| 1726 | | if ( ! current_user_can( $cap ) ) |
| 1727 | | return; |
| 1728 | | } |
| 1729 | | } |
| 1730 | | |
| 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 ) ) |
| 1736 | | return; |
| | 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 | } |
| 1737 | 1736 | |
| 1738 | | // Bind pointer print function |
| 1739 | | add_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_' . $pointer ) ); |
| | 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 ) |
| | 1743 | return; |
| 1740 | 1744 | |
| 1741 | 1745 | // Add pointers script and style to queue |
| 1742 | 1746 | wp_enqueue_style( 'wp-pointer' ); |
| … |
… |
final class WP_Internal_Pointers {
|
| 1825 | 1829 | } |
| 1826 | 1830 | |
| 1827 | 1831 | /** |
| | 1832 | * Print 'New Feature: Current Theme Customize Link' for 3.4.0. |
| | 1833 | * |
| | 1834 | * @since 3.3.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 | * |
| 1830 | 1850 | * @since 3.3.0 |
diff --git wp-admin/themes.php wp-admin/themes.php
index 694ed0f..8e3d7aa 100644
|
|
|
$class = $screenshot ? 'has-screenshot' : '';
|
| 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. |