[wp-trac] [WordPress Trac] #38866: Custom CSS generates an update SQL query on every front end request

WordPress Trac noreply at wordpress.org
Tue Nov 22 11:40:24 UTC 2016


#38866: Custom CSS generates an update SQL query on every front end request
--------------------------+----------------------------
 Reporter:  bradyvercher  |       Owner:  peterwilsoncc
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.7
Component:  Themes        |     Version:
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+----------------------------
Changes (by peterwilsoncc):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"39338"]:
 {{{
 #!CommitTicketReference repository="" revision="39338"
 Themes: Prevent unneeded database updates in `wp_get_custom_css_post()`.

 When a custom header image was set but custom CSS was not,
 `wp_get_custom_css_post()` was generating an UPDATE query on every
 frontend request.

 In theme options the header image meta data is stored as an object. In
 `update_option()` this hits an edge case as the resource IDs of the old
 and new values never match.

 This changes the logic of `wp_get_custom_css_post()` to ensure
 `set_theme_mod()` is only called when the custom CSS has changed.

 Props bradyvercher, helen.
 Fixes #38866.
 }}}

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


More information about the wp-trac mailing list