[wp-trac] [WordPress Trac] #22805: Add a hook for the live theme preview event
WordPress Trac
noreply at wordpress.org
Fri May 2 13:42:58 UTC 2014
#22805: Add a hook for the live theme preview event
-------------------------+----------------------
Reporter: alexvorn2 | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Appearance | Version: 3.4.2
Severity: normal | Resolution: wontfix
Keywords: | Focuses:
-------------------------+----------------------
Changes (by ocean90):
* keywords: needs-patch =>
* status: new => closed
* resolution: => wontfix
* milestone: Awaiting Review =>
Comment:
I agree to comment:3. Settings shouldn't be saved just because I preview
something. `get_option()` supports a third parameter to define a default
value, which should have in your case the same value as after a theme
activation.
There is also an action `start_previewing_theme`![1] and you can use
`$wp_customize->is_preview()`![2].
![1]:
https://developer.wordpress.org/reference/hooks/start_previewing_theme/
![2]:
https://developer.wordpress.org/reference/classes/wp_customize_manager/is_preview/
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22805#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list