[theme-reviewers] Theme Customizer Question
Emil Uzelac
emil at uzelac.me
Wed Jun 4 01:56:21 UTC 2014
I don't think that you need is_admin at all. Customizer already covers the
roles and capability by default.
See http://themes.svn.wordpress.org/twentyfourteen/1.1/inc/customizer.php
for examples.
Also see:
http://kwight.ca/2012/12/02/adding-a-logo-uploader-to-your-wordpress-site-with-the-theme-customizer/
this will give you an idea how API works :)
On Tue, Jun 3, 2014 at 8:01 PM, Stephen Cui <scui2005 at gmail.com> wrote:
> Hi, Chip:
>
> I found the issue after several hours of digging.
>
> Normal I only admin related function by checking is_admin()
>
> if ( is_admin() ) {
> require( get_template_directory() . '/core/theme-customizer.php' );
> }
>
> However, the preview is not admin. Thefore I have to remove the is_admin()
> check.
>
> Regards
>
> Stephen
>
>
>
> On Tue, Jun 3, 2014 at 5:41 PM, Chip Bennett <chip at chipbennett.net> wrote:
>
>> Can you post code somewhere? GitHub/Gist etc.? It's really impossible to
>> say for certain what the issue is without seeing what you're doing.
>>
>> Using the Options API (get_option()) works fine with the Customizer. Have
>> a look at Oenology if you need a code reference.
>>
>>
>> On Tue, Jun 3, 2014 at 4:58 PM, Stephen Cui <scui2005 at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am in the process to change my theme to use customize. I use method 3
>>> from Otto's tutorial. However, the customize preview and get_option does
>>> not work well. get_option is always getting the value from the database.
>>>
>>> Is this expected results? Do I missing anything here?
>>>
>>> Regards
>>>
>>> Stephen Cui
>>>
>>>
>>> _______________________________________________
>>> theme-reviewers mailing list
>>> theme-reviewers at lists.wordpress.org
>>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>>
>>>
>>
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>
>>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140603/d846ef45/attachment.html>
More information about the theme-reviewers
mailing list