[wp-trac] [WordPress Trac] #54472: Taxonomy: Unregistering taxonomy with default term endlessly regenerates options

WordPress Trac noreply at wordpress.org
Wed Jul 6 04:56:47 UTC 2022


#54472: Taxonomy: Unregistering taxonomy with default term endlessly regenerates
options
---------------------------------------------+--------------------------
 Reporter:  dlh                              |       Owner:  (none)
     Type:  defect (bug)                     |      Status:  new
 Priority:  normal                           |   Milestone:  6.1
Component:  Taxonomy                         |     Version:  5.5
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch commit needs-dev-note  |     Focuses:  performance
---------------------------------------------+--------------------------
Changes (by peterwilsoncc):

 * keywords:  has-patch needs-testing => has-patch commit needs-dev-note


Comment:

 I've tested this with a
 [https://gist.github.com/peterwilsoncc/7e9035d2130ca9cd3a8410a59359dd9f
 mini plugin] that registers and then unregisters a taxonomy with a default
 term.

 **Trunk**

 Each and every page load includes the following database queries:

 {{{#!sql
 INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`)
 VALUES ('default_term_pwcc_test_taxonomy', '19', 'yes')
 ON DUPLICATE KEY
 UPDATE `option_name` = VALUES(`option_name`), `option_value` =
 VALUES(`option_value`), `autoload` = VALUES(`autoload`);

 DELETE
 FROM `wp_options`
 WHERE `option_name` = 'default_term_pwcc_test_taxonomy';
 }}}

 **With the patch applied**

 The FIRST request adds the default option to the database as the taxonomy
 is registered:

 {{{#!sql
 INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`)
 VALUES ('default_term_pwcc_test_taxonomy', '19', 'yes')
 ON DUPLICATE KEY
 UPDATE `option_name` = VALUES(`option_name`), `option_value` =
 VALUES(`option_value`), `autoload` = VALUES(`autoload`);
 }}}

 The SECOND and subsequent requests make no changes to the database.

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


More information about the wp-trac mailing list