[wp-trac] [WordPress Trac] #22880: Customize Themes without activation
WordPress Trac
noreply at wordpress.org
Thu Nov 10 03:32:31 UTC 2016
#22880: Customize Themes without activation
-------------------------+------------------------------
Reporter: kkkrys | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: ui
-------------------------+------------------------------
Comment (by bluenestbryan):
I am also interested in this feature. I am a PHP developer with some WP
experience in writing plugins and themes. If it gets consensus and
implementing this isn't too complex, I am open to working on this if
possible. It sounds like we would need to 1) add an html button/control
for it, 2) create a query param to pass the value and 3) Check the value
and act accordingly. Numbers 1 and 3 seem pretty straight forward - the
relevant section of the `save_changeset_post()` method in `wp-includes
/class-wp-customize-manager.php` is below. It looks like that is where the
check would have to take place.
{{{#!php
$data = apply_filters( 'customize_changeset_save_data',
$data, $filter_context );
// Switch theme if publishing changes now.
if ( 'publish' === $args['status'] && !
$this->is_theme_active() ) {
// Temporarily stop previewing the theme to allow
switch_themes() to operate properly.
$this->stop_previewing_theme();
switch_theme( $this->get_stylesheet() );
update_option( 'theme_switched_via_customizer',
true );
$this->start_previewing_theme();
}
}}}
----
'''Regarding the opinion on the best way to implement this in the UI:
'''I think the existing "Save and Activate" is doing two things which
should have been separate to start with, but obviously users now have an
expectation. I am wondering if perhaps an "Activate theme" checkbox or
dropdown next to the button would be clear enough - the button would have
to be renamed "Save" for clarity.
Looking forward to discussing more.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22880#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list