Ticket #20554: 20554.5.diff

File 20554.5.diff, 3.5 KB (added by ryan, 12 months ago)

custom background too

Line 
1Index: wp-admin/includes/template.php
2===================================================================
3--- wp-admin/includes/template.php      (revision 20834)
4+++ wp-admin/includes/template.php      (working copy)
5@@ -1708,6 +1708,8 @@
6                        'post-new.php' => 'wp330_media_uploader',
7                        'post.php'     => 'wp330_media_uploader',
8                        'themes.php'   => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ),
9+                       'appearance_page_custom-header' => 'wp340_choose_header_from_library',
10+                       'appearance_page_custom-background' => 'wp340_choose_header_from_library',
11                );
12 
13                // Check if screen related pointer is registered
14@@ -1720,6 +1722,7 @@
15                        'wp330_media_uploader' => array( 'upload_files' ),
16                        'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ),
17                        'wp340_customize_current_theme_link' => array( 'edit_theme_options' ),
18+                       'wp340_choose_header_from_library' => array( 'edit_theme_options' ),
19                );
20 
21                // Get dismissed pointers
22@@ -1845,6 +1848,21 @@
23        }
24 
25        /**
26+        * Print 'New Feature: Current Theme Customize Link' for 3.4.0.
27+        *
28+        * @since 3.4.0
29+        */
30+       public static function pointer_wp340_choose_header_from_library() {
31+               $content  = '<h3>' . __( 'New Feature: Choose Image from Library' ) . '</h3>';
32+               $content .= '<p>' . __( 'Want to use an image you uploaded earlier? Select it from your media library instead of uploading it again.' ) . '</p>';
33+
34+               WP_Internal_Pointers::print_js( 'wp340_choose_header_from_library', '#choose-from-library-link', array(
35+                       'content'  => $content,
36+                       'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left' ),
37+               ) );
38+       }
39+
40+       /**
41         * Prevents new users from seeing existing 'new feature' pointers.
42         *
43         * @since 3.3.0
44Index: wp-admin/custom-header.php
45===================================================================
46--- wp-admin/custom-header.php  (revision 20834)
47+++ wp-admin/custom-header.php  (working copy)
48@@ -588,7 +588,7 @@
49                $image_library_url = remove_query_arg( 'TB_iframe', $image_library_url );
50                $image_library_url = add_query_arg( array( 'context' => 'custom-header', 'TB_iframe' => 1 ), $image_library_url );
51        ?>
52-       <span class="howto"><?php _ex( 'or', 'Custom Header: Choose an image from your computer - or - Choose from image library' ); ?></span> <a class="thickbox" href="<?php echo $image_library_url; ?>"><?php _e( 'Choose from image library' ); ?></a>
53+       <span class="howto"><?php _ex( 'or', 'Custom Header: Choose an image from your computer - or - Choose from image library' ); ?></span> <a class="thickbox" id="choose-from-library-link" href="<?php echo $image_library_url; ?>"><?php _e( 'Choose from image library' ); ?></a>
54 </td>
55 </tr>
56 <?php endif; ?>
57Index: wp-admin/custom-background.php
58===================================================================
59--- wp-admin/custom-background.php      (revision 20834)
60+++ wp-admin/custom-background.php      (working copy)
61@@ -260,7 +260,7 @@
62        $image_library_url = add_query_arg( array( 'context' => 'custom-background', 'TB_iframe' => 1 ), $image_library_url );
63 ?>
64        </form>
65-       <span class="howto"><?php _ex( 'or', 'Custom Background: Choose an image from your computer - or - Choose from image library' ); ?></span> <a class="thickbox" href="<?php echo $image_library_url; ?>"><?php _e( 'Choose from image library' ); ?></a>
66+       <span class="howto"><?php _ex( 'or', 'Custom Background: Choose an image from your computer - or - Choose from image library' ); ?></span> <a id="choose-from-library-link" class="thickbox" href="<?php echo $image_library_url; ?>"><?php _e( 'Choose from image library' ); ?></a>
67 </td>
68 </tr>
69 </tbody>