'Showing alert when creating a new category in admin wordpress
I am trying to figure out/learn how creating a custom plugin and calling it from another page in wordpress work.
I created a custom plugin and this plugin contains a function that when called will show the user/admin an alert notification div confirming their action.
When the admin create a new category i would like to display the notification in the header. So i have this line:
add_action('create_category', category_custom_alert(), 10)
now since is an action in the wordpress dashboard - where should i place this action call? I placed it under wp-admin/admin-functions.php.
My custom plugin function is as follows:
function category_custom_alert() {
?>
<div class="bootstrap-inside" id="category_custom_alert">
<div class="alert alert-success alert-dismissble" role="alert">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Success!</strong> Your category has been created successfully.
</div>
</div>
<?php
}
When i run this i am not seeing my custom notification message appear.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
