Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add individual options #109

Closed
bassjobsen opened this issue Feb 11, 2014 · 1 comment
Closed

Can't add individual options #109

bassjobsen opened this issue Feb 11, 2014 · 1 comment

Comments

@bassjobsen
Copy link
Owner

add_action('jbst_add_to_customizer','jbst_*_customizer_options'); give an error on the front when trying an individual option after disabling with define('jbst_customizer',0);

bassjobsen added a commit that referenced this issue Feb 12, 2014
@bassjobsen
Copy link
Owner Author

This issue had been fixed.

//disable Customizer
add_action('jbst_child_settings','jbst_child_set_defaultoptions');

function jbst_child_set_defaultoptions() {
    define('jbst_customizer',0); // or 1
}

The above disable all options and don't load any extra code.
Note this will not disable the customizer. WordPress offers a default customizer with settings for "Site title & Tagline", "Navigation" and "Static Front Page".

//show only Typography and Buttons
add_action('jbst_child_settings','jbst_child_set_defaultoptions');

function jbst_child_set_defaultoptions() {
    if(!defined('jbst_customizer'))define('jbst_customizer',1);
    add_filter('jbst_customizer_options',function($options){return array('typography','buttons');});    
}

Available options are: 'grid','mainnavigation','container','gridfloatbreakpoint','logo','navbar','background','typography','buttons','blog','discussion','footer'

//Disable all, but load the functions to enable add your own settings
add_action('jbst_child_settings','jbst_child_set_defaultoptions');

function jbst_child_set_defaultoptions() {
    if(!defined('jbst_customizer'))define('jbst_customizer',1);
    add_filter('jbst_customizer_options',function($options){return array();}); //empty array
    add_action('jbst_add_to_customizer','jbst_customfield_customizer_options'); 
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant