From 17f9635a45c78b422bb3d15b6a26e3644a84912b Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 21 May 2012 20:34:20 +0000 Subject: [PATCH] Feature pointers for choosing an image from the library on the custom header and background pages. see #20554 git-svn-id: http://core.svn.wordpress.org/trunk@20839 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-background.php | 2 +- wp-admin/custom-header.php | 2 +- wp-admin/includes/template.php | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index c2b05c081..3e4d3f1a1 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -260,7 +260,7 @@ if ( get_background_image() ) { $image_library_url = add_query_arg( array( 'context' => 'custom-background', 'TB_iframe' => 1 ), $image_library_url ); ?> - + diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index ca047b8d9..98ead449c 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -588,7 +588,7 @@ var farbtastic; $image_library_url = remove_query_arg( 'TB_iframe', $image_library_url ); $image_library_url = add_query_arg( array( 'context' => 'custom-header', 'TB_iframe' => 1 ), $image_library_url ); ?> - + diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index b06c903dd..883ec0848 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1708,6 +1708,8 @@ final class WP_Internal_Pointers { 'post-new.php' => 'wp330_media_uploader', 'post.php' => 'wp330_media_uploader', 'themes.php' => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ), + 'appearance_page_custom-header' => 'wp340_choose_image_from_library', + 'appearance_page_custom-background' => 'wp340_choose_image_from_library', ); // Check if screen related pointer is registered @@ -1720,6 +1722,7 @@ final class WP_Internal_Pointers { 'wp330_media_uploader' => array( 'upload_files' ), 'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ), 'wp340_customize_current_theme_link' => array( 'edit_theme_options' ), + 'wp340_choose_image_from_library' => array( 'edit_theme_options' ), ); // Get dismissed pointers @@ -1844,6 +1847,21 @@ final class WP_Internal_Pointers { ) ); } + /** + * Print 'New Feature: Choose Image from Library' for 3.4.0. + * + * @since 3.4.0 + */ + public static function pointer_wp340_choose_image_from_library() { + $content = '

' . __( 'New Feature: Choose Image from Library' ) . '

'; + $content .= '

' . __( 'Want to use an image you uploaded earlier? Select it from your media library instead of uploading it again.' ) . '

'; + + WP_Internal_Pointers::print_js( 'wp340_choose_image_from_library', '#choose-from-library-link', array( + 'content' => $content, + 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left' ), + ) ); + } + /** * Prevents new users from seeing existing 'new feature' pointers. *