Displaying errors with settings api

No, you need to add a call to settings_errors /** * Displays all messages registered to ‘your-settings-error-slug’ */ function your_admin_notices_action() { settings_errors( ‘your-settings-error-slug’ ); } add_action( ‘admin_notices’, ‘your_admin_notices_action’ ); Else the errors you added will not be displayed. You may also want to check that error_found is true. It is not a wordpress constant I … Read more

Echoing a variable inside a function

Use the Settings API. A look at my latest plugin may help you to understand how to register a save function for your fields. Most relevant excerpt: /** * Register custom settings for the fields. * * @see save_settings() * @see print_input_field() * @return void */ public function add_contact_fields() { register_setting( ‘general’, $this->option_name, array ( … Read more

Where to hook settings api init

Try it like this: if (isset($_REQUEST[‘tab’]) && $_REQUEST[‘tab’]) { typesetter_save_settings(); } register_sections(); $current = isset($_REQUEST[‘tab’]) ? $_REQUEST[‘tab’] : ‘page’; You have to check for a certain field of $_REQUEST (or $_POST etc.) before accessing it—or you get warnings.

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