Dropdown pages in Settings API
Dropdown pages in Settings API
Dropdown pages in Settings API
When using an options array the Settings API isn’t creating the database record
I’ve found out that having mulitple settings_fields wouldn’t work. So in register_setting I use the same group name and now all the fields are updated correctly. I got it from this http://www.mendoweb.be/blog/wordpress-settings-api-multiple-sections-on-same-page/
Change your id from plugin_text_string to plugin_options.
So far the only solution I’ve come up with is creating a function that postMessages the event into the iframe (using customize_controls_enqueue_scripts hook). As for the receiver in iframe (hooked on customize_preview_init hook) I think it could still need some optimization because I’m getting a weird issue with window.addEventListener(‘message’,* getting some duplicate on customizer loading.. … Read more
You’re creating a string representation of an array, when you need an actual array! $blogusers = get_users(); $options = array(); foreach ( $blogusers as $user ) { $options[ $user->user_email ] = $user->user_email; // No need to pass through __(), don’t translate emails! } And then pass it to your options argument: $this->form_fields = array( ‘sec_r2_mail’ … Read more
That’s because you need to print your settings fields in Kaipo_menu_callback, something like: <?php function Kaipo_menu_callback() { ?> <div class=”wrap”> <h2>Kaipo</h2> <form action=”options.php” method=”post”><?php do_settings_sections( ‘kaipo_menu_page’ ); settings_fields( ‘kaipo_menu_page’ ); submit_button(); ?></form> </div> <?php } I would strongly suggest reading the settings API in detail.
You will have to create a settings page on which you will have to register your settings. Unfortunately this is no easy task, but it has been very well documented on tutsplus. Once you have implemented the settings api, you can check for the options that have been set with your settings page. Depending on … Read more
WordPress Settings – Custom Button actions
I found the answer. Problem was I was retrieving those setting option values outside the if statement if(isset($_POST[‘formvalue’])){ } and using them inside it. For that reason values were actually not pulled from database.