[wp-trac] [WordPress Trac] #63257: sanitize_term_field missing default $context value

WordPress Trac noreply at wordpress.org
Fri Nov 7 12:54:38 UTC 2025


#63257: sanitize_term_field missing default $context value
----------------------------------------+-----------------------
 Reporter:  dilipbheda                  |       Owner:  audrasjb
     Type:  defect (bug)                |      Status:  accepted
 Priority:  normal                      |   Milestone:  6.9
Component:  Taxonomy                    |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+-----------------------

Comment (by wildworks):

 Just one quick question: if we add a default value, will it affect
 consumers who are already using the `"term_{$field}"` or
 `"{$taxonomy}_{$field}"` filters?

 For example, consumers may be using hooks such as the following:

 {{{
 add_filter( 'term_name', function( $value, $term_id, $taxonomy, $context )
 {
     if ( empty( $context ) ) {
         return 'something';
     }
     return $value;
 }, 10, 4 );
 }}}

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


More information about the wp-trac mailing list