[wp-trac] [WordPress Trac] #23863: Post Formats: allow filtering content_width per format in wp-admin

WordPress Trac noreply at wordpress.org
Mon Mar 25 21:03:27 UTC 2013


#23863: Post Formats: allow filtering content_width per format in wp-admin
--------------------------+------------------
 Reporter:  lancewillett  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.6
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+------------------

Comment (by lancewillett):

 This sort-of works:

 {{{
 /**
  * Resizes image restriction in wp-admin Media "large" size for video and
 image
  * post formats.
  *
  * @param array $dim Dimensions, height x width.
  * @param string $size Image size.
  * @param string $context 'edit' for wp-admin on 'display' for front-end.
  * @return array Resized dimensions to fit Twenty Thirteen's desired
 widths.
  */
 function twentythirteen_test( $dims, $size, $context ) {
         /*
         @todo How to tell from wp-admin if we're in a Video or Image post
 format?
         And, if you click Add New to make a new post, then click one of
 the Post Format tabs ...
         how does the Media editor know you've switched?
         */

         if ( 'large' == $size && 'edit' == $context )
                 return array( 724, 724 );
 }
 add_filter( 'editor_max_image_size', 'twentythirteen_test', 10, 3 );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23863#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list