[wp-trac] [WordPress Trac] #61220: manage_media_columns filter conflict

WordPress Trac noreply at wordpress.org
Wed May 15 12:52:00 UTC 2024


#61220: manage_media_columns filter conflict
----------------------------+-----------------------------
 Reporter:  grandplugins    |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Media           |    Version:  6.5.3
 Severity:  major           |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 The **'manage_media_columns'** filter hook in **wp-admin/includes/class-
 wp-media-list-table.php** passes two arguments.

 {{{#!php
 <?php
 return apply_filters( 'manage_media_columns', $posts_columns,
 $this->detached );

 }}}


 This filter collides with the **"manage_{$screen->id}_columns"** filter
 hook in **wp-admin/includes/screen.php** which passes one argument.

 {{{#!php
 <?php
 $column_headers[ $screen->id ] = apply_filters(
 "manage_{$screen->id}_columns", array() );
 }}}



 Trying to filter in media columns like that works fine in **Library**
 page.
                 {{{#!php
 <?php
 add_filter( 'manage_media_columns', array( $this,
 'filter_media_table_columns' ), 100, 2 );
 }}}


 buy results to a **Too few arguments fatal error** in **Add New Media
 File** page

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61220>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list