Declaration of mandoe_menu_walker::start_el(&$output, $item, $depth, $args) must be compatible with Walker::start_el(…)

An entirely different approach. nav menu item are stored in posts table, so you can technically attach a post_meta into it, even other data like nav item class already stored in post mata table. However this wasn’t easy to do before. but after 5.4.0 release, they have implemented hooks to easily do this. Here’s the … Read more

Update option hook not firing

Because you’re registering your hook inside the function that is rendering the form. When the form is submitted, the update_option action has already run before it gets to displaying the form. Move it outside the function. As it appears you’re using a class, adding the action to the __construct method might be a good idea.

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