Skip to main content

Questions tagged [notices]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
35 views

is_embed and is_search called incorrectly by wp_robots filter

I've been getting the below errors for quite some time now, but I haven't been able to figure out the root cause. Notice: Function is_embed was called incorrectly. Conditional query tags do not work ...
CragMonkey's user avatar
1 vote
2 answers
898 views

Display notice in block editor after wp_insert_post_data hook

I have a custom post type which checks and validates some (custom) meta fields added with it upon publishing. I am using wp_insert_post_data for the purpose: public function __construct() { $this-&...
sariDon's user avatar
  • 265
0 votes
1 answer
32 views

How $_GET['updated'] variable is passed when updating a user?

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 ...
sariDon's user avatar
  • 265
1 vote
1 answer
204 views

Cannot DIsplay a Snackbar Notice on Button Click - Notice is undefined

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 ...
Badan's user avatar
  • 225
1 vote
1 answer
803 views

Notices in the Block Editor with multiple lines

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' )....
Borje's user avatar
  • 123
0 votes
1 answer
2k views

Changing the HTML of notices in WooCommerce [closed]

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 ...
p01ntbr34k's user avatar
0 votes
1 answer
404 views

Hide all Admin Notices and move on a separate page

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. ...
Liton Arefin's user avatar
1 vote
0 answers
23 views

WordPress notification reports

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 ...
km onur's user avatar
  • 129
1 vote
1 answer
2k views

register_setting & add_settings_error validation issues with multiple fields

I've been trying to use the Settings API for the first time. I managed to piece together a working example but I'm stuck on how to make multiple input fields required. Right now I have an admin ...
Jon's user avatar
  • 313
0 votes
1 answer
1k views

Changing wordpress/woocommerce notices default message to other languages (text)

Hi I'm kind of new to WordPress and right now I'm changing the notice message with filters and overwriting them inside functions.php. like this: add_filter('woocommerce_lost_password_message', ...
Kia Abdi's user avatar
1 vote
1 answer
3k views

How to display only specific Error types in debug.log? No notices, warnings, etc

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/...
Viktor Borítás's user avatar
0 votes
0 answers
27 views

Notices are render inside sub-menu's content

I develop a plugin but I've got a problem when I render sub-menus (added with the hook admin_menu). At the moment of the callback, I render the content with the following: <div class="wrap"> ...
ozob's user avatar
  • 1
0 votes
1 answer
26 views

Troubleshooting Admin_Notice

I have this code at the top of a plugin: function my_mwe_admin_notice(){ echo '<div class="notice notice-error">'; echo '<h1>Notice this.</h1>'; echo '</div>'; } ...
MikeiLL's user avatar
  • 579
1 vote
1 answer
837 views

Wordpres debug.log PHP Notice: is_singular was called

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>. ...
Gabriel's user avatar
  • 11
0 votes
1 answer
1k views

admin_notices is not working inside function

I am creating a plugin . But when I trying to call the add_action('admin_notices','my_test_notice_1'); inside a function its not working. I need to call the add_action('admin_notices','...
Shafiqul Islam's user avatar
1 vote
0 answers
17 views

Mute Debug Messages from Plugins

I have an older plugin installed that is firing all these PHP Deprecated and PHP Notices in my debug.log every time a page loads. Is it possible to mute PHP Deprecated and PHP Notices but ONLY for ...
mike's user avatar
  • 111
1 vote
1 answer
3k views

Notice: Trying to get property 'term_id' of non-object

I receive the error on taxonomy page in wp-admin.Before this error, I had problem that couldnt add the taxonomy to menu because of my taxonomy code.I fixed the code then the current error became.So, ...
Faruk rıza's user avatar
3 votes
2 answers
2k views

How do I fire a snackbar notice in admin?

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 ...
Fanky's user avatar
  • 317
2 votes
1 answer
649 views

Change message given when deleting post from custom post type

So I have a custom post type called members. linked with advanced custom fields and I've made it so if I delete a member from the custom post type it doesn't move to the trash and permanently deletes ...
Asta's user avatar
  • 25
0 votes
0 answers
81 views

Is it possible to push admin notices to one specific user instead of all users?

guys. I wonder if it is possible to display an admin notice to the user with the ID of, say, 3, while all other users won't receive the notice?
Gary Hu's user avatar
  • 25
1 vote
0 answers
183 views

How to display a WordPress notice on create_term action

I am hijacking create_term to do stuff when a new term is created... // Fire the function when new term is created add_action( 'create_term', 'process_term', 11, 3 ); function process_term($term_id, ...
Robert Andrews's user avatar
1 vote
1 answer
2k views

Admin Notices don't display on the admin screen for certain post

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 ...
P.Belberov's user avatar
0 votes
1 answer
776 views

Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?

Writing a little plugin my code is like this: add_action( 'edit_user_profile_update', 'sulock_save_profile_fields' ); function sulock_save_profile_fields( $user_being_edited_id ) { if(...
Blackbam's user avatar
  • 555
2 votes
1 answer
538 views

Remove Admin Notice on page refresh

I have a simple question about admin notices. I want to display a message like 'Record updated successfully', and when user refresh again same page, then this notice should not be there as no record ...
W.Ahmed's user avatar
  • 23
2 votes
1 answer
2k views

Alter admin notices to remove message that contain a certain string

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 ...
Felix Eve's user avatar
  • 241
1 vote
0 answers
258 views

How to do persistent data on Front End?

I´m doing a plugin with a member system. I need to : display notices ( error, warning, info ) for visitors when they fill the form to subscribe. To match with my core project, I need a system with a ...
J.BizMai's user avatar
  • 870
0 votes
2 answers
9k views

relocate woocommerce notices/messages on Cart page

EDIT: see solution below from @motivast. With his basic setup you can then make whatever changes you'd like to specific auto-scroll actions and relocate whichever specific notices you want. My final ...
Jon Fergus's user avatar
0 votes
1 answer
177 views

Hide admin notice when user profile updated

I added an admin notice to the subscribers profile screen to invite them to complete their profile's extra fields. How can the notice hide automatically when the user updates the profile? When a user ...
Artus's user avatar
  • 92
1 vote
2 answers
2k views

Warning Notice $wpdb->prepare incorrect number of arguments passed

I am receiving this notice when trying to use the $wpdb->prepare function: Notice: wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (7) for the ...
Benjamin's user avatar
  • 185
0 votes
1 answer
354 views

admin notice on Insert Media popup screen

I want an admin notice box on all media upload pages. I did that for media library page by code add_action( 'load-upload.php', array( $this, 'media_library_message_load' ) ); public function ...
Meenakshi Khandelwal's user avatar
0 votes
1 answer
745 views

Problem with display data from get_option

I have a problem with get_option function. I created options page with one field for testing in form. Everything saving data to database, but when i try display it i getting "Undefined index", but ...
Adrian's user avatar
  • 3
0 votes
1 answer
572 views

Dynamically set taxonomy term and show admin notice on post save

I have a taxonomy of "date" listing all months of the year. And I have a custom field of "start_date". I would like to update the 'date' taxonomy dynamically so the user doesnt need to click both when ...
mattbru's user avatar
  • 75
2 votes
1 answer
343 views

How to add a link to the tax term in the admin Edit page?

I have a custom taxonomy, 'genre.' I'd like my editors, from the 'Edit Genre' screen (in the admin), to be able to link to the front end page for that genre/term. So, at the top of the 'Edit Genre' ...
Leora Deans's user avatar
0 votes
0 answers
98 views

Get property of non-object on theme activation

I am getting a notice from the reviewer: Make sure that your template doesn’t raise any PHP errors, notices or warnings on activation. Enabling wp_debug and using the Debug Bar plugin can help ...
Deka87's user avatar
  • 131
0 votes
1 answer
266 views

Find out if post was just updated on post edit screen

Is it possible to add an admin_notice to the post.php edit screen in the admin– only if the post was just updated. function my_admin_notice(){ global $pagenow; if ( $pagenow == 'post.php' ) { ...
rob-gordon's user avatar
1 vote
1 answer
344 views

How to inform the user that the save was not successful?

When saving a post, i have a meta box in which the user must put something. If the user input is something when i do not accept, how will i tell him? add_action('save_post' , 'my_save_metaboxe_data');...
Shake-the-World's user avatar
4 votes
2 answers
1k views

How to customize post edit notices

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?
maxime schoeni's user avatar
1 vote
0 answers
90 views

Display popup or admin-notice after add new categories

I need to display an admin notice or better a js popup after adding a new category. In my functions.php I've created 2 functions: add_action('create_category', 'popup_reminder_caller'); function ...
Kreker's user avatar
  • 127
0 votes
1 answer
3k views

Getting admin notices to appear after page refresh

I am hooking into the profile_update event in order to perform an action to member profiles when they are saved from the backend. After the event and my code is triggered Wordpress redirects the page ...
Louis W's user avatar
  • 464
1 vote
1 answer
443 views

Popup or admin/update notice on post/page edit screen without page refresh

Wordpress has similar functionality when another user is "taking over" editing a post WP gives you an instant warning. I want to be able to either trigger a popup or show a new admin notice on top of ...
Jay's user avatar
  • 11
2 votes
1 answer
315 views

How to notify the admin about something that happened during a cron job

Our company has put out a Wordpress plugin that consumes our content api. Problem is, some of the content goes away. Sometimes for a time, sometimes forever. To be on the legal safe side we have to ...
Sorcy's user avatar
  • 145
6 votes
1 answer
1k views

Wordpress admin notice in plugin function

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 ...
Bullman's user avatar
  • 161
1 vote
1 answer
5k views

PHP notice coming from the WordPress core?

Do you also experience this particular notice? ( Of course one has to turn on the DEBUG mode at the wp-config.php to be able to see this kind of a notice ). > Notice: add_shortcode_param is ...
Average Joe's user avatar
  • 1,879
0 votes
1 answer
323 views

Show message from backend

I need to show messages on wordpress page editor, when a page is updated. I know there is a admin_notice hook to show messages. I have a save_post_page perfectly working on my code, but I need to know ...
Ismael Moral's user avatar
3 votes
2 answers
1k views

Add custom post notice after post delete

I am trying to add a custom info notice after the post has been deleted from the trash, but I'm not having any luck with it add_action( 'delete_post', 'show_admin_notice' ); /** * Show admin notice ...
dingo_d's user avatar
  • 1,950
6 votes
1 answer
6k views

How to stop showing admin notice after close button has been clicked

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="...
iSaumya's user avatar
  • 934
0 votes
1 answer
946 views

wp_new_comment requires author url and author email

I am using the wp_new_comment() (previously used the wp_insert_comment()) function. I now notice that I get a Notice: Undefined index: comment_author_url and a: Notice: Undefined index: ...
theyuv's user avatar
  • 209
1 vote
0 answers
188 views

How to throw admin notice error on image upload

I created a plugin that creates a new image size and turns it B&W. I need the script to throw an notice if the user upload an image smaller then 1000x1000. I tried this, but Wordpress is ...
a.barbieri's user avatar
1 vote
1 answer
1k views

Displaying "One Time" Notification in Plugins

In WordPress's backend, you can add notifications and errors using HTML that looks like this <div class="updated error"> <p><?php esc_html_e( 'A bad thing happened!', 'your-text-...
Alana Storm's user avatar
2 votes
1 answer
141 views

Admin Notices coding standard issue

I am having a bit of an issue right now with the VIP coding standards. I am trying to print out an admin notice as follows: add_action( 'admin_notices', function() { $class = 'notice notice-...
bretterer's user avatar
  • 123