bassjobsen / jbst

Powerful theme framework that can be used as a standalone website builder or as a framework to create child themes for wordpress build on Twitter's Bootstrap 3. Full customizable with LESS
http://www.jbst.eu/
GNU General Public License v2.0
96 stars 36 forks source link

Can't add individual options #109

Closed bassjobsen closed 10 years ago

bassjobsen commented 10 years ago

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 commented 10 years ago

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'); 
}