Link category is a simple taxonomy just like categories , named: link_category
so to add one you can use wp_insert_term()
eg:
wp_insert_term(
'My link category', // the term
'link_category', // the taxonomy
array(
'description'=> 'this is a description.',
'slug' => 'my-link-category'
)
);
and to make all this happen on plugin activation take a look at register_activation_hook
Related Posts:
- How to redirect to settings page once the plugin is activated?
- How to output message during plugin activation
- Prevent network activation of plugin
- Inserting Taxonomy Terms During a Plugin Activation?
- Using wp_cron with custom time interval and the register activation hook
- Call activation hook multiple times
- Only allow plugin to be activated on root site of multisite
- why creating tables using $wpdb is not being executed while installing plugins?
- Override pluggable functions in a plugin?
- Plugin activation error due to unexpected output
- Settings not set after calling register_setting()
- Insert terms for custom taxonomy on plugin activation, or each page load (init hook)
- WordPress Plugin Activate / Deactive Failing
- Multiple array for post_content on plugin activation
- Class cannot be found, but it’s available in the file, I get: Fatal Error: Uncaught Error: Class ‘Blocks\Base\Activation’ not found
- Plugin can’t be activated [closed]
- Clean way to initialize plugin in newly-added site when plugin has been network activated?
- Activate / Deactivate plugin
- WordPress Fatal error: Uncaught Error: Call to undefined function dbDelta()
- Custom Plugin activation error in Multisite
- How to store in the database directly the translation?
- Unable to show a message after plugin activation
- Refresh or redirect page after activate my plugin
- I can install my plugin in localhost but not in my server
- WordPress plugin tables become corrupt
- Deactivate plugin on registration
- how can a plugin return an error message on activation?
- Is there a canonical way for a plugin to install a mu-plugin or drop-in?
- My activator class isn’t running the code inside
- Is it mandatory to use $wpdb->prefix in custom tables
- add_action hook for completely new post?
- Is get_option function cached?
- How do I log plugin (cron) actions?
- Is there a hook for when you switch themes?
- Problems after wp_set_password() containing an apostrophe
- Error getting correct blog_id on MU from functions.php
- Front-End Form Submission in Shortcode
- Plugin Localization
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- array_map() for sanitizing $_POST
- Why cant the WP Filesystem API read googlefonts.json?
- calling jquery function on plugin page
- Is there a faster way than wp_insert_post to add content to a blog
- Ajax in WordPress – path issue
- How to determine if the current file is loaded in a plugin or in a theme?
- Decrease RSS cache time in plugin?
- Check if someone is editing a post (this content is currently locked)
- How to add a custom tag in contact form 7 and change the output in email?
- How can I create a plugin that changes the title color of a website?
- How to check if Woocommerce Order number equals to post ID?
- Two functions utilizing registration_errors filter
- Issue plugin commands in admin settings page
- Creating a shortcode, but getting tied up with OOP and Classes?
- Call PHP file within a plugin to activate function
- add_action not calling back to function
- Example Dashboard Widget, Cancel not working
- add_shortcode() not working inside of function
- How to add and remove a page
- correct way to call javascript into hook function
- “dashboard”-named PHP file doesn’t get included
- How to get plugin activate URL to use URL vars?
- rewrite URL based on selected taxonomy for post page
- How to Upload Images From a Folder (Not WP_Uploads)
- Possible to get all posts with my shortcode?
- Plugin uninstall function is not working
- esc_html__() and __() not working within arrays
- Uploaded attachment not set as featured image
- WordPress – manually relate a post to page(s)?
- Styles don’t load correctly. Insecure content
- How to use apiFetch to get author information in Gutenberg properly?
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Can we use a library under MIT license in a WooCommerce plugin?
- How to display the specific post content by using POST ID
- Soap web service request from wordpress plugin
- How to list all images used on a specific page?
- Create fixed static pages
- Use options to control jQuery plugin
- Including template in shortcodes
- Is there anything special required to make a plugin work in a multisite environment?
- How to exclude categories from get_categories() select list inside a widget admin panel
- How to exclude “uncategorized” from custom categories widget?
- Using custom IDP with WP
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- Using WordPress Boilerplate (WPBP) for WP Multisite Plugin
- WordPress5.2.3: Better File Download Plugin validation issue
- How do I make secure API calls from my WordPress plugin?
- esc_attr() on hard coded string
- Creating a return url for getting data from external api
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- How to use functions from Woocommerce documentation?
- Is it possible to restore an expired transient?
- WP API users per page
- action callback, for action dispatched as reported by hook sniffer, not called
- variable created in page.php is null inside of header.php
- Access WordPress Tag Function From Modal
- Problem with Poedit [closed]
- Insert plugin html content to a specific spot in the frontpage
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Anyway to prevent admin from seeing other admin’s product?
- Programmatically creating posts based on external JSON feed (asynchronously)