Permalink
Browse files

Update to new media manager.

Getting rid of the old thickbox infavor of WordPress 3.5's manager.
Also adds a brief message that will hopefully cut down on the number of
users that insist on inserting
  • Loading branch information...
1 parent 2456c90 commit 36d8e2c06caa355367d7987e2bdc83b8f0cd30d5 Michael Sisk committed Jan 24, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 -/php/posts.php
View
@@ -141,8 +141,7 @@ public function admin_enqueue_scripts() {
wp_enqueue_script( 'webcomic-admin-meta' );
if ( !in_array( 'editor', self::$config[ 'collections' ][ $screen->id ][ 'supports' ] ) ) {
- add_thickbox();
- wp_enqueue_script( 'media-upload' );
+ wp_enqueue_media();
}
}
}
@@ -718,7 +717,7 @@ public static function ajax_media_preview( $id ) {
$old_content_width = $content_width;
$content_width = 266;
- printf( '<a href="%s" class="thickbox">', esc_url( str_replace( array( 'post_id=0', 'TB_iframe=1' ), array( "post_id={$id}", 'tab=gallery&TB_iframe=1' ), get_upload_iframe_src( 'image' ) ) ) );
+ echo '<style scoped>.insert-media img{vertical-align:bottom}</style><a href="#" class="insert-media">';
foreach ( $attachments as $attachment ) {
echo isset( $_wp_additional_image_sizes[ 'post-thumbnail' ] ) ? wp_get_attachment_image( $attachment->ID, 'post-thumbnail' ) : wp_get_attachment_image( $attachment->ID, array( $content_width, $content_width ) );
@@ -730,7 +729,10 @@ public static function ajax_media_preview( $id ) {
} else {
$post_ID = $post_ID ? $post_ID : $id;
- printf( '<a href="%s" class="thickbox">%s</a>', get_upload_iframe_src( 'image' ), __( 'Add Attachments', 'webcomic' ) );
+ printf( '<a href="#" class="button insert-media">%s</a><p>%s</p>',
+ __( 'Add Media', 'webcomic' ),
+ __( 'Webcomic will automatically recognize any images attached to this post. You <strong>do not</strong> have to insert them directly into the post content.', 'webcomic' )
+ );
}
}

0 comments on commit 36d8e2c

Please sign in to comment.