[wp-trac] [WordPress Trac] #30251: Customizer inconsistent contextual behavior
WordPress Trac
noreply at wordpress.org
Wed Nov 5 20:08:15 UTC 2014
#30251: Customizer inconsistent contextual behavior
--------------------------+-------------------------
Reporter: dgwyer | Owner: ocean90
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 4.1
Component: Customize | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses: javascript
--------------------------+-------------------------
Comment (by westonruter):
Replying to [comment:5 dgwyer]:
> That seems to fix the issue on initial customizer load.
>
> I came across another issue just now when using 'is_page' as the
'active_callback' value. This is nothing to do with your patch though as
it happens regardless of whether the patch is applied or not.
OK, the problem is that `$wp_customize` is passed as the first argument to
the `active_callback`. The `is_page` function expects a page ID or string
slug. So what you should do instead is something to the effect of:
{{{
'active_callback' => function () { return is_page(); }
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30251#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list