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

Adding data to options table

This is an expansion of my comment on OP: function is_forum_subscribed($user_ID) { if($user_ID) { $useremail = $this->get_userdata($user_ID, ‘user_email’); $list = get_option(“mf_forum_subscribers_”.$this->current_forum, array()); if(in_array($useremail, $list)) return true; } return false; } } You can call this function like this, instead: is_forum_subscribed($player->ID);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)