[wp-trac] [WordPress Trac] #30387: Theme customizer section vanishes if code is inside is_admin() block
WordPress Trac
noreply at wordpress.org
Tue Nov 25 08:48:24 UTC 2014
#30387: Theme customizer section vanishes if code is inside is_admin() block
--------------------------+------------------------------
Reporter: Latz | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: trunk
Severity: normal | Resolution:
Keywords: close | Focuses: administration
--------------------------+------------------------------
Comment (by Fab1en):
I have the same issue because I include the customizer files in my theme
only if `is_admin` :
{{{
if(is_admin()) {
require_once(dirname(__FILE__).'/customizer/title/register.php');
require_once(dirname(__FILE__).'/customizer/background_gradient/register.php');
require_once(dirname(__FILE__).'/customizer/post/register.php');
}
}}}
If that is a bad practice, it should be mentionned in
[http://codex.wordpress.org/Theme_Customization_API#Developing_for_the_Theme_Customizer
the Codex].
This was also very hard to debug because controls **are** added to the
customizer panels, but hidden later with JavaScript.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30387#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list