Take a look at admin notices. If you the cols parameter isn’t set use some code like this:
function sample_admin_notice_fail() {
?>
<div class="notice notice-error is-dismissible">
<p><?php _e( 'You forgot the cols parameter!', 'sample-text-domain' ); ?></p>
</div>
<?php
}
add_action( 'admin_notices','sample_admin_notice_fail' );
to display this notice:

on top of your admin page.
You find some more information about implementing admin notices on this page.
Related Posts:
- No Error Log File, no debug info
- How should one implement add_settings_error on custom menu pages?
- Prevent notice and warnings in error_reporting?
- How to log plugin errors to plugin error_log file
- Catch own Exceptions
- Throw 403 in a plugin [duplicate]
- why don’t I get error messages in admin when developing?
- WP_Error handles errors, but how can I show success with a message?
- Settings API – Undefined Index when unchecking checkbox
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- How can I display an error message after post has been saved?
- Execution limit and Memory limit errors even i changed to 1024M and 600(cache.php,load.php)?
- Proper way to pass credentials in a custom login form to avoid “headers already sent”
- Two functions utilizing registration_errors filter
- How can I gracefully escape an error condition?
- WordPress debug messages not displaying
- Custom Post Type Object – Undefined Variables
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- Plugin can’t be activated [closed]
- How do I debug an error that a plugin is causing?
- Need Help Determining Where Header Error is Happening
- “Rendering of admin template [path to template] failed”
- Is there any way to pass messages from a script to a redirect target in a hidden fashion?
- Import images remotly run through timeout error
- Error code when migrate
- WPGut – Updating failed and shortcode?
- GET request return value as error instead of success
- WP_Fatal_Error_Handler OR WP_Error OR try/catch
- Custom Plugin activation error in Multisite
- Warning: Illegal string offset – on homepage
- Not able to Update database while creating a custom module
- Plugin error on activation – breaks page encoding and prints the code of plugin php files
- Getting error of unexpected output during activation
- Trying to build a plugin – Cannot modify header information
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- Strategies to implement selective loading of plugins
- Can someone explain what wp_session_tokens are, and what are they used for?
- How to Change the Entire WordPress Admin panel Look and Feel?
- how to use thickbox in admin?
- lodash dependency in a Gutenberg plugin
- How does WordPress treat rewrite rules “under the hood”?
- Plugin vs Settings load order (woocommerce dependency)
- Screenshot are not showing up on plugin page
- How to not let a user with a new role edit users that have administrator role?
- Callback function is being called twice
- async code or cron job?
- How to display a message about updates in the plugin list
- Loading jQuery and jQuery plugin script files correctly [duplicate]
- WordPress not working on localhost
- manage_posts_custom_column, showing serial number using increment in loop
- Custom delete option button in plugin settings
- Sub Menu content is being duplicated
- how to append custom metabox field with the ACF custom fields id in wordpress development
- $_FILES empty on created_{taxonomy} and create_{taxonomy} yet is is not on edit_{taxonomy}
- Storing data in wordpress database from ajax call from different website
- Prevent invalid or empty values from being saved to the database and retain the form field values upon error
- Hide shortcodes “code” when using the “editor” the same as wordpress do with “gallery”
- wp E-commerce featured product plugin with muliple option?
- Adding fields to category manager. Does a method exist to get the link to the category edit screen?
- How to test a WordPress plugin in real time
- How to Trigger WP CRON at Local Timestamp?
- Problem with saving checkbox values with WordPress Widget API
- Force download file from plugin (change output http headers)
- Distributing Frontend Assets with Plugins
- How to get all product in the woo-commerce? [closed]
- Check user’s role and store in variable
- What’s the hook for filtering every texts of site?
- Hook add_attachment error
- Undefined variable’s error when expected to have passed the content of variable [closed]
- How can I add rewrite rules to a class-based plugin?
- hook update_option/updated_option empty $old_value and $value
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- How to add a panel/box/widget/are/screen to the right side of edit post/page confusion
- Sharing Variables between scheduled events
- Issue with plugin sub menu and pages
- How can I programmatically change a MySql variable (foreign_keys_check)?
- Problem with display data from get_option
- Best way to distribute templates and code accross multiple wordpress sites?
- WordPress templating system for custom plugins
- Lead form that submits to 2 external APIs
- Modify code for functions.php with specific twitter user url and hashtags
- get_the_date() returns english Year & Day when language is Arabic
- Where to save Gutenberg plugin data?
- Add new header/footer on landing page with plugin
- Redirect with message after admin_post.php
- Plugin MySQL SELECT custom data and filter on user meta
- Multi hook deploiement
- Why Worpdress doesn’t create table in database?
- Endpoint Callback Display for Custom Plugin
- Get Commentor IP When Marking Comment As Spam
- What is the use of wp_schedule_event hook?
- How to show custom taxonomy child posts through shortcode in WordPress
- Best practice to include custom user styles in widgets
- Very Quick Custom Pluggable Function Question
- Sending Parameter Failed
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Why is WordPress wrapping search for users that looks like integers with asterisks and how do I fix it?
- how to works woocommerce cart hash
- Create a custom filter in WordPress extensions page
- Package a custom post type, and taxonomies, with their block templates in a plugin