Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [20884] trunk/wp-admin: Improve appearance of "choose from library" link for headers and backgrounds. Date:Thu, 24 May 2012 21:03:38 +0000 (UTC)
 

Revision
20884
Author
ryan
Date
2012-05-24 21:03:38 +0000 (Thu, 24 May 2012)

Log Message

Improve appearance of "choose from library" link for headers and backgrounds. Props SergeyBiryukov, sabreuse. see #20737

Modified Paths

Diff

Modified: trunk/wp-admin/custom-background.php (20883 => 20884)


--- trunk/wp-admin/custom-background.php	2012-05-24 19:58:22 UTC (rev 20883)
+++ trunk/wp-admin/custom-background.php	2012-05-24 21:03:38 UTC (rev 20884)
@@ -250,17 +250,23 @@
 <tr valign="top">
 <th scope="row"><?php _e('Upload Image'); ?></th>
 <td><form enctype="multipart/form-data" id="upload-form" method="post" action="">
-<label for="upload"><?php _e('Choose an image from your computer:'); ?></label><br /><input type="file" id="upload" name="import" />
-<input type="hidden" name="action" value="save" />
-<?php wp_nonce_field('custom-background-upload', '_wpnonce-custom-background-upload') ?>
-<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
-<?php
-	$image_library_url = get_upload_iframe_src( 'image', null, 'library' );
-	$image_library_url = remove_query_arg( 'TB_iframe', $image_library_url );
-	$image_library_url = add_query_arg( array( 'context' => 'custom-background', 'TB_iframe' => 1 ), $image_library_url );
-?>
+	<p>
+		<label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
+		<input type="file" id="upload" name="import" />
+		<input type="hidden" name="action" value="save" />
+		<?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?>
+		<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
+	</p>
+	<?php
+		$image_library_url = get_upload_iframe_src( 'image', null, 'library' );
+		$image_library_url = remove_query_arg( 'TB_iframe', $image_library_url );
+		$image_library_url = add_query_arg( array( 'context' => 'custom-background', 'TB_iframe' => 1 ), $image_library_url );
+	?>
+	<p>
+		<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
+		<a id="choose-from-library-link" class="button thickbox" href="<?php echo esc_url( $image_library_url ); ?>"><?php _e( 'Choose Image' ); ?></a>
+	</p>
 	</form>
-	<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>

Modified: trunk/wp-admin/custom-header.php (20883 => 20884)


--- trunk/wp-admin/custom-header.php	2012-05-24 19:58:22 UTC (rev 20883)
+++ trunk/wp-admin/custom-header.php	2012-05-24 21:03:38 UTC (rev 20884)
@@ -579,16 +579,19 @@
 		<label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
 		<input type="file" id="upload" name="import" />
 		<input type="hidden" name="action" value="save" />
-		<?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ) ?>
+		<?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ); ?>
 		<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
 	</p>
-	</form>
 	<?php
 		$image_library_url = get_upload_iframe_src( 'image', null, 'library' );
 		$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 id="choose-from-library-link" class="thickbox" href="<?php echo $image_library_url; ?>"><?php _e( 'Choose from image library' ); ?></a>
+	<p>
+		<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
+		<a id="choose-from-library-link" class="button thickbox" href="<?php echo esc_url( $image_library_url ); ?>"><?php _e( 'Choose Image' ); ?></a>
+	</p>
+	</form>
 </td>
 </tr>
 <?php endif; ?>