Use the action created_term
. Its first parameter is the $term_id
.
It is called in wp_insert_term()
in wp-includes/taxonomy.php
after a term was successful created:
do_action("created_term", $term_id, $tt_id, $taxonomy);
do_action("created_$taxonomy", $term_id, $tt_id);
The second parameter is the term_taxonomy_id from the term_taxonomy
table, and the last parameter is the taxonomy.
So register an action with …
add_action( 'created_term', 'wpse_78858_add_color', 10, 3 );
… and your callback should look like this:
function wpse_78858_add_color( $term_id, $tt_id, $taxonomy )
{
# do something
}
Related Posts:
- Add screen options to custom admin pages
- Add self-closing shortcode button to TinyMCE in WP 4.6
- WordPress and PHP Sessions – Security and Performance
- WordPress Hook for user register
- Must-use plugins autoloader: How to use get_plugins() correctly?
- Changing upload directory for plugin uploads only
- Upload file to remote storage
- How do I conditionally enqueue script for CPT single post type with plugin?
- Is it possible to remove next-post / previous-post with out creating a custom template?
- wp_localize_script $handle
- Escaping built-in WP function return strings
- Help adding image upload functionality to widget
- One time username change from frontend?
- How to extend a plugin like we do a theme?
- How to add custom text in wordpress logs
- Rewrite url for existing page without flush_rewrite_rules
- Front-End Interfaces Without Shortcodes
- Is there a way to loop through a shortcode datasource to create a table?
- Execute plugin for specific user role(s) only
- How can I render shortcode so that its not cached by Caching plugins?
- WordPress REST API, run long background job
- Make a list with header and subtext in Gutenberg blocks
- Does WordPress support WebP images?
- How plugins_loaded works?
- Enqueue scripts in footer
- Is It Always a Best Practice to Decouple the Frontend from the Admin Area When Developing a WordPress Application?
- the_editor() function
- Including the necessary functions for a custom ajax registration form
- $_FILES empty on created_{taxonomy} and create_{taxonomy} yet is is not on edit_{taxonomy}
- What should happen when a WordPress Plugin is activated across the network (Network Wide Activation)
- Send push when new post is published in a certain category
- How can we display product price $104 on the cart while the credit card payment method is checked?
- 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
- Translation per IP location [closed]
- Hide shortcodes “code” when using the “editor” the same as wordpress do with “gallery”
- wp E-commerce featured product plugin with muliple option?
- 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
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- 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]
- Google credentials and redirect URI for Google OAuth2 in a WordPress plugin, questions
- How to add plugin options in wp editor page
- 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
- Service Worker Uncaught (in promise) DOMException
- 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
- WordPress Plugin Boilerplate: Addition of 3rd party scripts and styles [closed]
- How to format custom fields when editing an attachment?
- Screenshots on plugin page taken old [closed]
- Get Posts by IDs (optionally)
- How do I duplicate a single post, with all its properties, and save it as a different post?
- Why doesn’t my Table get created?
- Extract Information from post content (using regex?)
- Using jQuery prepend() with file include
- want to show CMB2 metabox on woocommerce product data tab
- Customise Grouped Product display in Woocommerce with custom column
- Add parameters to 3rd party callback function
- Ajax action has 200 status but response of No response data available for this request
- How does update method in Widget class saves $instance array from Select tag?
- Google Web Core Vitals – management, how to in wordpress and advice
- How can I pass WP_Query results to a plugin?
- Hiding the WordPress login and password fields from login page
- Adding customs fields on each product on the cart
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- Buddypress: adding a new tab direct user to their author page
- Why would one specify multiple arguments when using get_previous_posts_link() which takes only one parameter?
- WC_Geolocation not found inside plugin
- Set widget icon in Customizer?
- How to customize the size of Featured Images or Post Thumbnails in WordPress?
- I have a plugin where in I have to change the title of the page dynamically by sending parameter to the_title filter
- How can I map a specific URL pattern to a plugin for processing
- Issue on Getting Images URL of the Post Gallery
- What happens when you create/edit a menu
- Updating Style From WP Options Setting Page
- Change the class of wordpress menu
- WordPress.org how to force expire Cached Banner-772×250 from my Plugin page
- What is the Timeline for the Active Version Pie Chart in the Repository?
- How to change url’s in WordPress when changing domain [duplicate]
- Email verification feature in wordpress social login plugin
- Plugin – Proper way to handle 404 pages?
- Is wordpress plugin development active? [closed]
- how to catch a data from a array in WordPress
- get the queried_object of an url
- External api call using wordpress
- Set link dialog to open in blank by default
- plugabble wp_authenticate function not works from wp-login.php
- How to get recent one post from each category on home page?