I am working on a site and sometimes I run into an error when logging out and on the site tab it says 'Wordpress Failure Notice'. I am trying to remove all instances of wordpress so users dont know Im using it, but I can not figure out how to remove the text from the tab. I dont have no code to try and show because Im not even sure where to start. The text shows up on the wp-login.php …
I have started to get alot of "is_singular was called" and "is_page was called" in my debug.log [31-May-2020 12:10:27 UTC] PHP Notice: is_page was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.1.0.) in /wp-includes/functions.php on line 5167 [31-May-2020 12:10:27 UTC] PHP Notice: is_singular was called <strong>incorrectly</strong>. Conditional query tags do not work before …
i have sample wordpress plugin class. Im hooking woocommerce woocommerce_saved_order_items and i want create a admin notice. Add action from __construct works, but when i want create a notice in hook function it doesnt appears, where is the problem? class SomeClass { private static $instance; public function __construct() { add_action('woocommerce_saved_order_items',array($this,'orderStatusChange'),10,1); add_action('admin_notices', array($this,'simple_notice')); // This works } public static function getInstance() { if(!self::$instance) self::$instance = new SomeClass(); return self::$instance; } public function orderStatusChange($orderID){ add_action('admin_notices', 'simple_notice');//This not works } function simple_notice(){ ?> …
I can't find the right way to make it work. I tried many things, like putting this in wp-config.php define('WP_DEBUG', true); define('WP_DEBUG_DISPLAY', false); define('WP_DEBUG_LOG', 'wp-content/themes/mytheme/mylog.log' ); // yeah, customized it a bit. It logs everything ini_set('error_reporting', E_ERROR ); also tried to set it in the php.ini on various websites i manage. Not on managed hosting. Or at least not on the well known international ones. Can it be server side or syntax error, or not even possible what i want? …
Why is there a constant notice, JQMIGRATE: Migrate is installed, version 1.4.0 that points to load-scripts.php in my console when I updated my theme to WordPress 4.5, and how can it be removed? It's not an error, but it's always present in my console, and I really don't see what's the point of it. Should I update something, or make some changes to my code? Maybe I have a bit of OCD, but usually when I inspect the site, I …
I have added two user metas and they are functioning perfectly. Now I want to show a warning message according to the input. I have passed the status through a get variable(named meta_warning through add_query_arg) and the message is displayed accordingly. But on refreshing the page, the message repeats (since the get variable is passed directly in the url). I have noticed that the wordpress is using a similar variable (updated=1) to show the 'User Updated' message. But this variable …
I need some customization of WORDPRESS comment area, so I've used this code in my child theme : <div id="comments" class="x-comments-area"> <?php if ( have_comments() ) : ?> <?php //The author of current post $author_ID = get_the_author_meta("ID"); //The current post ID $p_ID = get_the_ID(); ?> <h2 class="h-comments-title"><span><?php _e( 'Comments' , '__x__' ); ?> <small> <?php //Number of guest comments echo ztjalali_persian_num(number_format_i18n(count(get_comments(array('post_id' => $p_ID,'author__not_in' => array($author_ID)))))); ?></small></span></h2> <ol class="x-comments-list"> <?php wp_list_comments( array( 'callback' => 'x_icon_comment', 'style' => 'ol' ) ); ?> …
I have errors in WordPress: PHP Notice: Undefined offset: 0 in /home/userpro/public_html/wp-content/themes/hoon/inc/tweaks.php on line 602 PHP Notice: Trying to get property of non-object in /home/userpro/public_html/wp-content/themes/hoon/inc/tweaks.php on line 602 Code: /** * Display Future Posts * * Display future post in the events category to all users. */ function hoon_show_all_future_posts( $posts ) { global $wp_query, $wpdb; if ( is_single() && $wp_query->post_count == 0 ) { $events_cat = hoon_option( 'events_category' ); $request = $wpdb->get_results( $wp_query->request ); /* Line 602 bellow */ if …
If WP_DEBUG is not set, as I understand it, you should never ever see warnings. But on some sites on some servers, I'm still seeing a few. Not all the warnings that would be displayed if WP_DEBUG was set, but a select few. I've tried changing the error level in php.ini, but that seems to have no effect on whether warnings appear or not, but they do appear in differing amounts on different servers (i.e. no warnings on development, one …
I have a custom plugin and want it on occasions to fire the kind of notice that appears and disapears in the left corner like this one: I found some code in the Gutenberg docs here: const MySnackbarNotice = () => ( <Snackbar> Post published successfully. </Snackbar> ); But adding this to my admin-enqueued js script obviously doesn't work. Thanks!
First of all I do know how to add admin notice in the wordpress admin menu. And I added an admin notice like this: <?php add_action( 'admin_notices', function() { ?> <div class="notice notice-success is-dismissible"> <p><?php _e( 'Imagine something here!', 'sample-text-domain' ); ?></p> </div> <?php }); Now my code is running fine and smooth, just with one problem. You see right now this notice starts showing up as soon as the user activates the plugin. and it stays up top until …
I am trying to use withSelect and withDispatch to display an admin notice when "save" button is clicked. I am using the following code from this repo but it throws an error: "notices is undefined". Here is the code I am using: import { Icon, Button, SnackbarList } from '@wordpress/components'; import { dispatch, withSelect, withDispatch } from '@wordpress/data'; import { compose } from '@wordpress/compose'; // Display and Dispatch the notice const NewNotices = ({ notices, removeNotice }) => { //Uncaught …
I am adding an admin notice via the conventional admin_notice hook in my plugin: function my_admin_notice() { ?> <div class="notice notice-info is-dismissible"> <p><?php _e( 'some message', 'my-text-domain' ); ?></p> </div> <?php } if ( my_plugin_show_admin_notice() ) add_action( 'admin_notices', 'my_admin_notice' ); How can I control where wordpress places the admin notice, in the html on the current screen, without using Javascript?
The page https://developer.wordpress.org/block-editor/how-to-guides/notices/ has the following code for adding a notice to the block editor: ( function ( wp ) { wp.data.dispatch( 'core/notices' ).createNotice( 'success', // Can be one of: success, info, warning, error. 'Post published.', // Text string to display. { isDismissible: true, // Whether the user can dismiss the notice. // Any actions the user can perform. actions: [ { url: '#', label: 'View post', }, ], } ); } )( window.wp ); This works fine for me …
I've enabled a plugin that sets an admin notice saying the cron is not running. This is not true - I'm just using an actual cron triggered via WP CLI as opposed to WP's poor man so there is no need for this message. Unfortunately it looks like there is no hook to alter admin messages before they are rendered, but is there a way to filter messages that contain a certain string and stop them from being displayed?
I'm creating a WooCommerce theme from scratch, and I'd really like to change the HTML that wraps the default WooCommerce messages on the Cart and Checkout pages. I am specifically talking about the default messages that appear in this element, when the cart is updated - or items are removed: <div class="woocommerce-message" role="alert"> Your cart has been updated / Product was removed. Undo? </div> I have tried several things; I am overriding the default error.php, success.php and notice.php templates in …
I want to hide all 'admin_notices' from dashboard means everywhere. I've a separate Menu name "Admin Notice". I want to move all notices there so I can manage them separately by user roles. There will be 2 columns- Display the full Notice User roles dropdown I'm struggling to find out with Codex Documentation. If Someone can help me I will be greatful.
I want to make a featured image required. For starters i am trying to show an error message after update or post buttons are pressed. The problem is that the notices which i try to include don't show up. For example function my_admin_notice(){ global $pagenow; if ( $pagenow == 'post.php' ) { echo '<div class="updated"> <p>This notice only appears on the plugins page.</p> </div>'; } } add_action('admin_notices', 'my_admin_notice'); Whatever notice i try to display in specific post admin screen it …
I had to make a standalone dashboard for WordPress. I designed an interface to notify users of information messages (eg wrong user password) such as verification of forms and files or errors. But I have to carry messages just like wordpress. It is carrying messages in the WordPress admin panel with I guess (transients). (1) Is this true or did I get it wrong? NOTE: As far as I know WooCommerce also uses a similar method while giving an error …
How to customize the notice message ('Post published' or 'Post updated') displayed when I add or edit a custom post type registered with register_post_type() function?