How to create woocommerce administrator notification for plug-ins – woocommerce development

When woocomer developers create themes or woocomer plug-ins, they often need to create administrator notifications. Woocommerce administrator notifications can be alerts to users about updates, progress, or important matters in advance. The example of woocommerce administrator notification usually WordPress administrator notification may be different, with different color codes, and displayed at the top of the administrator page, as shown in the following image of woocommerce administrator notification. The administrator will specify the color on the left border of the notification, as shown in the following figure.
The five types of notification colors are gray, red, green, orange and blue. If the class name is given, red is used to display errors, green is used to display success messages, orange is used for warnings, blue is used for notification information, and gray is used for default notification. Common word press administrator notifications may appear in the following image with the corresponding code. If you want to copy the male code, here are the code snippets notified by each word press administrator. Basic tips
Basically, the notice can be cancelled
Male information announcement
Male or female information prompt can be turned off
Male or female information prompt alt
Male successful declaration male
Male success notification can be closed
Male successfully notified alt
Warning notice
Male can turn off warning notification male
Warning prompt alt
Male error notification male
Male error notification male
Male can ignore the error prompt male
As can be seen from the code above, the difference of notification is the classes assigned to word press administrator notification. Below is a list of the four most commonly used woocommerce administrator notification classes.
Error notification: Note error class success notification: Note success class notes: Note info class warning notification: to create a note warning class, a woocomer or WordPress administrator notifies an administrator notification, you must use a task hook connected to the admin_notes event. The notification div and content must be added to the callback function of the action hook. The plug-in can use the administrator notification hook to let users receive notifications of important updates, information or warnings. WordPress error notification example the following is an example of an error notification.


Male word press information announcement example the following is an example of information notification.

Male conclusion this post describes how to create administrator notifications in the development of word press and woocommerce plug-ins. You need to understand various word press administrator notification classes and add messages to the task hook connected to admin_notes hook. This is the end of the method for creating woocommerce administrator notifications.
From similar articles, phpMyAdmin is the method to obtain the current user role from WordPress and display roles. There are four simple options to reset the WordPress password. Delete the build through storefront and wormerce footnote links. If you are not logged in to WordPress, how to redirect the user? The page redirects WordPress management How to solve the problem that the dashboard cannot be displayed correctly and the CSS cannot be loaded? How to use the actual example to display the category name in word press? How to display woocommerce products by category? No plug-in is needed and word press contact form 7 spam is being processed
Methods to access the WordPress administrator dashboard or log in to the WordPress dashboard. Woodpress sets the method of recommended products. The method of confirming that users log in to WordPress. The method of obtaining post ID from WordPress through slug through practical examples. The method of woodcommerce deleting or disabling comments No plug-in programming hides the word press management bar method no plug-in programming deletes the word press management menu item method obtains the login user information from word press method woocommerce redirection after checkout: the method of automatically redirecting to the custom page after checkout woocommerce Instructions on how to move under the image, how to get the order ID from woocomerce, and how to ensure that users log in to WordPress

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *