Family Encyclopedia >> Electronics

How to add warning notices for your clients in WordPress

As a consultant, developer or designer, sometimes you get hired to do the project and you walk away. Often in these circumstances, many developers customize the WordPress admin area and remove all the main configuration options, so the client cannot break the site. However, it's really frustrating when another developer walks in only to find out that he has to pull out a bunch of code to see the setup. Or even if the owner decides that he wants to do things himself, he does not have the freedom to do so. The main goal of WordPress is to empower the publisher and give them the freedom to publish content the way they want. Therefore, in this article, we will show you how to grant your clients full administrative access, but we will include warning notices for them, so that they know the consequences of their actions. By simply hooking into the WordPress admin_notices hook, we can display a notice that may say "Warning:Changing settings on this page may cause issues with your website design."

How to add warning notices for your clients in WordPress

First open your theme's functions.php file, and then paste the following:

add_action ('admin_notices', 'my_admin_notice'); function my_admin_notice () global $ current_screen; if ($ current_screen-> parent_base == 'options-general') echo '

Advertencia: el cambio de configuración en estas páginas puede causar problemas con el diseño de su sitio web!


You can modify the notices for each screen.

Thanks to Jacob Goldman for pointing out this trick. This will be great for our customers.