Dynamic settings fields with Settings API

This issue is now resolved. I am posting the solution, in case someone else finds it useful. I have modified my callback for adding the checkbox list of categories so that the selected categories are saved in an array instead of separate options. It will make it much easier to find said special category and … Read more

How to handel multiple checkbox field in the admin settings page with Settings API

add_action( ‘admin_init’, ‘register_page_options’ ); function register_page_options() { if (false == get_option(‘aicp_settings_options’)) { add_option(‘aicp_settings_options’); } // Add Section for option fields add_settings_section( ‘aicp_section’, __( ‘….text here….’, ‘aicp’ ), ‘display_section’, ‘aicp_settings’ ); // id, title, display cb, page // Add Field for selecting countries for which you wanna ban ads add_settings_field( ‘aicp_country_list’, __( ‘Select the countries’, ‘aicp’ … Read more

Using tabs for wordpress plugin

If there is problem only with html markup you should check example from official jQuery UI site here: http://jqueryui.com/tabs/ It looks like yours, but for work you must check if your site include stuff like jquery and jquery ui script, jquery css is important too. After that you should have script with: $( “#tabs” ).tabs(); … Read more

Validate an option array

What you need to do is build your own data validation function. Ozh wrote a great tutorial about this earlier, but here’s the gist of it … Assume your options array is called $my_options and it contains three fields, ‘text’, ‘age’, and ‘isauthorized’. You would still register it the same way: register_setting( ‘my_setting’, ‘my_options’, ‘my_validation_function’ … Read more

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