Ticket #20554: 20554.4.diff

File 20554.4.diff, 2.6 KB (added by ryan, 12 months ago)

Pointer for choosing header image from library

  • wp-admin/includes/template.php

     
    17081708                        'post-new.php' => 'wp330_media_uploader', 
    17091709                        'post.php'     => 'wp330_media_uploader', 
    17101710                        'themes.php'   => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ), 
     1711                        'appearance_page_custom-header' => 'wp340_choose_header_from_library', 
    17111712                ); 
    17121713 
    17131714                // Check if screen related pointer is registered 
     
    17201721                        'wp330_media_uploader' => array( 'upload_files' ), 
    17211722                        'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ), 
    17221723                        'wp340_customize_current_theme_link' => array( 'edit_theme_options' ), 
     1724                        'wp340_choose_header_from_library' => array( 'edit_theme_options' ), 
    17231725                ); 
    17241726 
    17251727                // Get dismissed pointers 
     
    18451847        } 
    18461848 
    18471849        /** 
     1850         * Print 'New Feature: Current Theme Customize Link' for 3.4.0. 
     1851         * 
     1852         * @since 3.4.0 
     1853         */ 
     1854        public static function pointer_wp340_choose_header_from_library() { 
     1855                $content  = '<h3>' . __( 'New Feature: Choose Header from Libary' ) . '</h3>'; 
     1856                $content .= '<p>' . __( 'Want to use an image you uploaded earlier? Select it from your media library instead of uploading it again.' ) . '</p>'; 
     1857 
     1858                WP_Internal_Pointers::print_js( 'wp340_choose_header_from_library', '#choose-from-library-link', array( 
     1859                        'content'  => $content, 
     1860                        'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left' ), 
     1861                ) ); 
     1862        } 
     1863 
     1864        /** 
    18481865         * Prevents new users from seeing existing 'new feature' pointers. 
    18491866         * 
    18501867         * @since 3.3.0 
  • wp-admin/custom-header.php

     
    588588                $image_library_url = remove_query_arg( 'TB_iframe', $image_library_url ); 
    589589                $image_library_url = add_query_arg( array( 'context' => 'custom-header', 'TB_iframe' => 1 ), $image_library_url ); 
    590590        ?> 
    591         <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> 
     591        <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> 
    592592</td> 
    593593</tr> 
    594594<?php endif; ?>