我是靠谱客的博主 勤奋哈密瓜,最近开发中收集的这篇文章主要介绍wordpress弹窗通知_如何在WordPress中为您的客户添加警告通知,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

wordpress弹窗通知

As a consultant, developer, or designer, sometimes you just get hired to do the project and leave. Often in these circumstances, many developers customize the WordPress admin area and remove all the main settings options, so the client cannot break the site. However, it is really frustrating when another developer comes in just to find out that he has to take out bunch of code to see the settings. Or even if the owner decides they want to do things themselves, they don’t have the freedom to do so. The whole point of WordPress is to empower the publisher and give them freedom to publish content the way they want. Therefore in this article, we will show you how to give your clients full administrative access, but include warning notices for them, so they know the consequences of their actions. By simply hooking into WordPress admin_notices hook, we can display a notice that may say “Warning – changing settings on this page may cause problem with your website’s design”.

作为顾问,开发人员或设计师,有时您只是被雇用去做项目并离开。 通常,在这种情况下,许多开发人员自定义WordPress管理区域并删除所有主要设置选项,因此客户端无法破坏该站点。 但是,当另一个开发人员进来只是发现他必须拿出一大堆代码来查看设置时,这确实令人沮丧。 或者,即使所有者决定要自己做某事,他们也没有这样做的自由。 WordPress的全部目的是赋予发布者权力,让他们自由地按自己想要的方式发布内容。 因此,在本文中,我们将向您展示如何授予客户完整的管理访问权限,但包括对他们的警告通知,以便他们知道其操作的后果。 通过简单地插入WordPress admin_notices钩子,我们可以显示一条通知,其中可能显示“警告-更改此页面上的设置可能会导致您的网站设计出现问题”。

Warning Notices for your Clients in WordPress

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

首先打开您主题的functions.php文件,然后粘贴以下内容:

add_action( 'admin_notices', 'my_admin_notice' );
function my_admin_notice(){
     global $current_screen;</div>
     if ( $current_screen->parent_base == 'options-general' )
          echo '<div><p>Warning - changing settings on these pages may cause problems with your website’s design!</p></div>';
}

You can modify the notices for each screen.

您可以修改每个屏幕的通知。

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

感谢Jacob Goldman指出这一技巧。 这将对我们的客户非常有用。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-add-warning-notices-for-your-clients-in-wordpress/

wordpress弹窗通知

最后

以上就是勤奋哈密瓜为你收集整理的wordpress弹窗通知_如何在WordPress中为您的客户添加警告通知的全部内容,希望文章能够帮你解决wordpress弹窗通知_如何在WordPress中为您的客户添加警告通知所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(54)

评论列表共有 0 条评论

立即
投稿
返回
顶部