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
This commit is contained in:
ryan 2012-05-21 20:34:20 +00:00
parent d8ed87e9e1
commit 17f9635a45
3 changed files with 20 additions and 2 deletions

View File

@ -260,7 +260,7 @@ if ( get_background_image() ) {
$image_library_url = add_query_arg( array( 'context' => 'custom-background', 'TB_iframe' => 1 ), $image_library_url );
?>
</form>
<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>
<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>
</td>
</tr>
</tbody>

View File

@ -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 );
?>
<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>
<span class="howto"><?php _ex( 'or', 'Custom Header: 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>
</td>
</tr>
<?php endif; ?>

View File

@ -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 = '<h3>' . __( 'New Feature: Choose Image from Library' ) . '</h3>';
$content .= '<p>' . __( 'Want to use an image you uploaded earlier? Select it from your media library instead of uploading it again.' ) . '</p>';
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.
*