[wp-trac] [WordPress Trac] #45955: Twenty Nineteen: get_the_archive_title filter issues

WordPress Trac noreply at wordpress.org
Sat Jan 12 06:31:09 UTC 2019


#45955: Twenty Nineteen: get_the_archive_title filter issues
-------------------------------------------------+-------------------------
 Reporter:  taskotr                              |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Bundled Theme                        |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  dev-feedback 2nd-opinion needs-      |     Focuses:
  patch                                          |
-------------------------------------------------+-------------------------
Changes (by mukesh27):

 * keywords:  dev-feedback => dev-feedback 2nd-opinion needs-patch
 * type:  defect (bug) => enhancement


Comment:

 @taskotr Theme already used {{{ add_filter( 'get_the_archive_title',
 'twentynineteen_get_the_archive_title' ); }}} archive filter with priority
 of 10 so if you want to override that filter with your plugin
 functionality then you have to add high priority then 10 then your filter
 works in Twenty Nineteen.

 For ex.

 If you have develop plugin with below filter then add below priority.
 {{{
 add_filter( 'get_the_archive_title', 'slug_set_the_archive_title', 99 );
 }}}

 If you have use any third party plugin and it's filter does not work then
 remove theme filter using below code.

 {{{
 remove_filter( 'get_the_archive_title',
 'twentynineteen_get_the_archive_title' );
 }}}

 For better solution, In Twenty Nineteen theme we needs to change filter
 priority to 1 instead of 10 so plugin can override filter as per there
 needs.

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


More information about the wp-trac mailing list