WordPress theme options tabs

WordPress includes many js libraries in \wp-includes\js and in wp-admin\js. You can browse through them and choose which one you want, including jQuery tabs. You can use it in your theme by using this function, http://codex.wordpress.org/Function_Reference/wp_enqueue_script To figure out how to use the tabs, you would read about it here: http://jqueryui.com/demos/tabs/

options validator input is false?

This kind of setup skeleton works for me to process the custom options page input : <?php /* Plugin Name: Settings Skeleton */ if(!class_exists(‘MySettings’)){ function call_my_settings() { return new MySettings(); } if (is_admin()){ add_action( ‘init’, ‘call_my_settings’ ); } class MySettings{ public function __construct(){ add_action(‘admin_menu’, array(&$this, ‘add_menu’)); add_action(‘admin_init’, array(&$this,’settings’) ); } public function add_menu(){ add_options_page(__(‘My Plugin … Read more

Caching of SQL queries

WordPress will only do a database lookup the first time if the option hasn’t been auto-loaded or already accessed prior. The performance hit is negligible, however if you’re loading multiple separate options with a bunch of get_options instead of using the serialised option functionality, then the initial lookup * X number of separate option rows … Read more

WordPress options text format

WordPress does not automatically texturize options. If you are using add_option(), update_option(), and/or get_option() then it should “just work”. Example: //Add an option to the database update_option(‘my_test_option’,’This is an option. Isn\’t it “special”?’); //Returns string: This is an option. Isn’t it “special”? echo get_option(‘my_test_option’);

Option does not save or update upon page refresh

Maybe a little debugging will help. Try this in your piece no.1 $theme = AisisCore_Factory_Pattern::create(‘AisisCore_Template_Builder’); if(isset($_POST[‘aisis_reset’])){ $theme->reset_theme_options(); } $options = get_option(‘aisis_reset’); print_r( $options ); //outputs $options value wp_die(); //will halt further process if($options == ‘true’){ echo ‘<div class=”alert alert-success”><strong>SUCCESS!!!!</strong> All Options have been reset! You can start again!</div>’; update_option(‘aisis_reset’, ‘false’); } What value do you … Read more

Incorporating the Settings API in WordPress Themes – by Chip Bennet

You should include your options-register-defaults.php to make the callback available. function chr_settings() { require_once ‘options-register-defaults.php’; // add path to file /* register_setting( $option_group, $option_name, $sanitize_callback )- Associates an option group passed to settings_fields with database entry */ register_setting( ‘mycustom_options’, ‘mycustom_options’, ‘ch_options_validate’ ); add_settings_section(‘ch_settings_defaults_style’, ‘Style Options’, ‘ch_settings_defaults_style_section_text’, ‘mycustom’); }

how can i add_option as array from a form with just a text input

Something like this should work. function si_ad_call_models() { if ( isset( $_POST[‘submit’] ) ) { // Checking that $_POST[‘new_model_name’] is set is probably not enough validation. if ( isset( $_POST[‘new_model_name’] ) ) { // Get the stored models. if ( get_option( ‘si_ad_call_model’ ) ) $si_ad_call_models = unserialize( get_option( ‘si_ad_call_model’ ) ); else $si_ad_call_models = array(); … Read more