您当前的位置:首页 > TAG信息列表 > notices
块编辑器中的多行通知
页面https://developer.wordpress.org/block-editor/how-to-guides/notices/ 具有以下代码,用于将通知添加到块编辑器:( function ( wp ) { wp.data.dispatch( \'core/notices\' ).createNotice( \'success\', // Can be one of: success, info, warning, error.
无法在按钮单击时显示快捷栏通知-通知未定义
我试图使用WITHELECT和withDispatch在以下情况下显示管理员通知;“保存”;单击按钮。我使用的代码如下repo 但它抛出了一个错误:“quot;通知未定义;。以下是我使用的代码:import { Icon, Button, SnackbarList } from \'@wordpress/components\'; import { dispatch, withSelect, withDispatch } from \'@wordpress/data\'; import {
更新用户时如何传递$_GET[‘UPDATED’]变量?
我添加了两个用户元,它们的功能非常好。现在,我想根据输入显示一条警告消息。我通过一个get变量(名为meta_warning 通过add_query_arg) 并相应显示消息。但是在刷新页面时,消息会重复(因为get变量直接在url中传递)。我注意到wordpress使用了一个类似的变量(updated=1)来显示“User updated”消息。但url中不存在此变量。我如何才能做到这一点?这样我的警告消息在重新加载时不会重复。memberAdmin.class.php<?php clas
如何在不使用Java脚本的情况下更改管理通知在html中的位置?
我通过传统的admin_notice 挂接我的插件:function my_admin_notice() { ?> <div class=\"notice notice-info is-dismissible\"> <p><?php _e( \'some message\', \'my-text-domain\' ); ?></p> </div> <?php
Wp_get_http已弃用。改用wp_http
我使用了一个高级插件(用于主题开发),其中包含WordPress导入器插件,我收到了一个弃用的通知:“wp\\u get\\u http已deprecated. 改用WP\\U Http“但是WP\\U Http将我发送到this function.问题是如何使用wp_http_supports 在以下代码中,而不是wp_get_http:function fetch_remote_file( $url, $post ) { // extract the file name and ext
插件选项数组设置为未定义
如果没有定义插件选项,我想将它们设置为空白,这样我就可以避免PHP注意事项。编写此代码的更好方法是什么?$options = get_option(\'plugin_options\'); // Add new plugin options defaults here if( !isset( $options[\'plugin_option_1\'] ) ) $options[\'plugin_option_1\'] = \'\'; if( !isset( $op
如何禁用子主题中的管理通知?
类似于https://wordpress.stackexchange.com/q/206735/92434, Disable update notification for individual plugins.我购买了一个主题,它在管理面板中显示一个通知,让所有管理员安装推荐的插件。在子主题中,如何禁用此通知以使其在将来不再出现在管理面板中?父主题正在使用TGM Plugin Activation 显示通知。
如何将参数传递给ADMIN_NOTICES?
因此,有以下情况。我需要在admin_notices.class MyPlugin_Admin { public static function render_admin_notice() { echo $name . \' has been upgraded.\'; } } add_action( \'admin_notices\', array( \'MyPlugin_Admin\', \'render_admin_no
恼人的“JQMIGRATE:Migrate is...”在更新到WordPress 4.5之后在控制台中
为什么总是有通知,JQMIGRATE:已安装迁移,版本1.4.0指的是load-scripts.php 在我的控制台中,当我将主题更新到WordPress 4.5时,如何删除它?这不是一个错误,但它总是出现在我的控制台中,我真的不明白这有什么意义。我应该更新一些东西,还是对代码进行一些更改?也许我有点强迫症,但通常当我检查网站时,我喜欢看到错误和真正的通知,指出我控制台中的问题。。。编辑WordPress 5.5删除了jQuery迁移脚本,作为将jQuery更新到5.6中最新版本的准备步骤。所以通知应该消
register_sidebar notice
我已经手动更新了我的站点,现在我在前端和后端都收到了以下通知:注意:register\\u侧栏调用不正确。未在参数数组中为“”设置id;主提要栏“;侧栏。默认为;侧栏-1“;。手动将id设置为;侧栏-1“;关闭此通知并保留现有侧栏内容。有关更多信息,请参阅WordPress中的调试。(此消息是在版本4.2.0中添加的。)如何修复此问题?
调试通知:从4.5版开始就不推荐使用X了!改用Y
我最近将WordPress更新为最新版本,现在我收到以下消息:注意:自4.5版以来,get\\u currentuserinfo已被弃用!请改用wp\\u get\\u current\\u user()。在/X/wordpress/wp中包括/功能。php在线3658注意:自4.5版以来,add\\u object\\u页面已被弃用!改用add\\u menu\\u page()。在/X/wordpress/wp中包括/功能。php在线3658我如何确定是谁负责生成这些PHP通知?
尝试在Comment-template.php中获取非对象通知的属性
我需要对WORDPRESS评论区进行一些自定义,因此我在我的子主题中使用了以下代码: <div id=\"comments\" class=\"x-comments-area\"> <?php if ( have_comments() ) : ?> <?php //The author of current post $author_ID = get_the_author_meta(\"
管理员注意到编码标准问题
我现在对VIP编码标准有点问题。我正在打印一份管理通知,如下所示:add_action( \'admin_notices\', function() { $class = \'notice notice-warning is-dismissible\'; $message = __( \'We suggest that you use the <b>API Key file</b> for your API Keys.\', \'package-wo
在插件中显示“一次性”通知
在WordPress的后端,您可以使用如下所示的HTML添加通知和错误<div class=\"updated error\"> <p><?php esc_html_e( \'A bad thing happened!\', \'your-text-domain\' );?></p> </div> 您可以使用添加这些通知admin_notices 钩add_action( \'admin_notices\
WP_NEW_COMMENT需要作者URL和作者邮件
我正在使用wp_new_comment() (以前使用wp_insert_comment()) 作用我现在注意到注意:未定义索引:comment_author_url和a:注意:未定义索引:comment\\u author\\u email在wp-includes/comment.php 文件以前,使用时wp_insert_comment() 我将参数中的这些字段留空(即:将它们从参数数组中删除),并且没有收到任何通知。为什么我现在收到这些争论的通知?对于wp_new_comment() 功能,但不用于
如何在点击关闭按钮后停止显示管理通知
首先,我知道如何在wordpress管理菜单中添加管理通知。我添加了这样的管理通知:<?php add_action( \'admin_notices\', function() { ?> <div class=\"notice notice-success is-dismissible\"> <p><?php _e( \'Imagine something here!\', \'sample-tex
帖子删除后添加自定义帖子通知
我试图在帖子从垃圾桶中删除后添加一个自定义信息通知,但我没有任何运气add_action( \'delete_post\', \'show_admin_notice\' ); /** * Show admin notice after post delete * * @since 1.0.0. */ function show_admin_notice(){ add_action( \'admin_notices\', \'show_
Deprecated issue in WordPress
我是WordPress开发的新手。我将WordPress网站的版本更新为4.6.1。然后我在调试中发现了这个错误。日志Notice: The called constructor method for WP_Widget in C_Widget_Gallery is deprecated since version 4.3.0! Use __construct() instead. in /home/spslive/public_html/wp-includes/functions.php
Show message from backend
当页面更新时,我需要在wordpress页面编辑器上显示消息。我知道有一个admin_notice 钩子显示消息。我有一个save_post_page 我的代码做得很好,但我需要知道如何连接它们,我不知道为什么?任何帮助都将不胜感激,顺致敬意,伊斯梅尔