Update custom settings field in plugin

Your code is saving the option, but your input field is not actually displaying the option’s value because you’ve used the wrong option name, which is url_field_name and should instead be webhook_url_field_name (the second parameter value for register_setting()). So the correct HTML would be: <!– I wrapped the value attribute for brevity –> <input type=”url” … Read more

how can a plugin return an error message on activation?

I use code similar to this to check for the minimum requirements for a plugin: if (is_admin()) { // check for required versions of WP and PHP $min_wp = ‘4.9.6’; $min_php = ‘7.2’; if (!check_requirements($min_wp, $min_php)) { add_action(‘admin_init’, ‘my_disable_plugin’); add_action(‘admin_notices’, ‘my_show_notice_disabled_plugin’); add_action(‘network_admin_init’, ‘my_disable_plugin’); add_action(‘network_admin_notices’, ‘my_show_notice_disabled_plugin’); my_deregister(); return; } } function check_requirements($min_wp, $min_php) { // see … Read more

How to change the headline title for an admin page in a plugin?

You shouldn’t need to hook anywhere in particular, simply output your heading at the start of your settings page callback and WP should position admin notices appropriately after your heading (there’s some logic written into the js/jquery). For example i have lines like this at the start of various plugin settings pages. <div class=”wrap”> <h1><?php … Read more

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