get_theme_mods does not have a filter
|Reported by:||scottsweb||Owned by:|
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)