Checkbox conflict in my custom plugin admin page

you are registering two separate settings groups for setting fields & the problem might be here. function set_options() { register_setting( ‘checkbox-1-settings’, ‘my_checkbox_1_name’ ); register_setting( ‘checkbox-2-settings’, ‘my_checkbox_2_name’ ); } so use only one settings group for both fields to see if it works. function set_options() { register_setting( ‘checkbox-settings’, ‘my_checkbox_1_name’ ); register_setting( ‘checkbox-settings’, ‘my_checkbox_2_name’ ); } Update … Read more

Settings API with arrays example

Short answer: your name attribute values must use the schema option_name[array_key]. So, when you use … <input name=”option_name[key1]”> <input name=”option_name[key2]”> … you get an array as option value in your validation function: array ( ‘key1’ => ‘some value’, ‘key2’ => ‘some other value’ ) PHP does that for you, this is not a WordPress feature. … Read more

Testing Rewrite Rules with PHPUnit

There are two problems here, a conceptual and practical Conceptional: What is it that you are testing? If you are testing that your function actually inserts the rule into the set of rewrite rules, than you should just inspect the generated rewrite rules array (from the option probably). Anything beyond that is not “unit testing” … Read more