[wp-trac] [WordPress Trac] #31029: Allow 0 columns in gallery settings

WordPress Trac noreply at wordpress.org
Mon Mar 2 21:23:45 UTC 2015


#31029: Allow 0 columns in gallery settings
-------------------------------------------------+-------------------------
 Reporter:  afercia                              |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Media                                |  Release
 Severity:  normal                               |     Version:  4.1
 Keywords:  needs-docs good-first-bug has-patch  |  Resolution:
                                                 |     Focuses:  ui,
                                                 |  javascript
-------------------------------------------------+-------------------------
Changes (by GunGeekATX):

 * keywords:  needs-patch needs-docs good-first-bug => needs-docs good-
     first-bug has-patch


Comment:

 Added filters for min and max values, as well as a filter to customize the
 name.  Example:


 {{{
 add_filter( 'media_gallery_columns_min',
 'ticket_31029_media_gallery_columns_min' );
 add_filter( 'media_gallery_columns_max',
 'ticket_31029_media_gallery_columns_max' );
 add_filter( 'media_gallery_columns_name',
 'ticket_31029_media_gallery_columns_name' );


 function ticket_31029_media_gallery_columns_min( $columns ) {
         return 0;
 }

 function ticket_31029_media_gallery_columns_max( $columns ) {
         return 20;
 }

 function ticket_31029_media_gallery_columns_name( $column ) {
         return $column === 0 ? __( 'None' ) : $column;
 }
 }}}

 [[Image(https://i.imgur.com/ka9i7va.png)]]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31029#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list