[wp-trac] [WordPress Trac] #39308: Invalid taxonomy error in WP 4.7

WordPress Trac noreply at wordpress.org
Sat Dec 17 21:57:32 UTC 2016


#39308: Invalid taxonomy error in WP 4.7
--------------------------+------------------------------
 Reporter:  wpfo          |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Taxonomy      |     Version:  4.7
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by wpfo):

 @theMikeD:
 I have resolved my problem using filter 'register_taxonomy_args'.
 It is about 2000 websites.

 @swissspidy:
 Regardless of plugin you should avoid overwriting 'name' property,
 taxonomy key.

 Slution 2 would be to ignore $args['name'] to avoid overwriting
 'name' Property (Taxonomy key) setted from param $taxonomy in
 __construct()
 {{{#!php
 <?php
 foreach ( $args as $property_name => $property_value ) {
         // Avoid overwriting 'name' Property ('Taxonomy key')
         if ( 'name' !== $property_name ) {
                 $this->$property_name = $property_value;
         }
 }

 }}}

 I have attached patches for both solutions.

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


More information about the wp-trac mailing list