[wp-trac] [WordPress Trac] #25671: get_theme_mods does not have a filter
WordPress Trac
noreply at wordpress.org
Wed Oct 23 15:38:08 UTC 2013
#25671: get_theme_mods does not have a filter
-------------------------+-----------------------------
Reporter: scottsweb | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords: has-patch
-------------------------+-----------------------------
I am making use of the Theme Modifications API for the first time and
using it to store theme customisation options controlled via the theme
customiser.
I hit an issue when previewing customisation changes using the refresh
transport. The theme modifications functions are not aware of the
`$_POST'd` changes coming from the theme customiser.
Let's say a user has changed a heading colour from red to blue and not yet
hit save. The `get_theme_mod('heading_colour')` function is still
returning red in the preview panel. This bug does not overly concern me
(it may be that way by design) but to get around it it would be handy to
be able to filter get_theme_mods (see patch).
For now I have gone higher up in the API and used a filter on
`get_option`:
{{{
add_filter( 'option_theme_mods_' . $theme_slug)
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25671>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list