The third argument for term_exists()
is an integer, not an array.
Parameters
- $term
- (integer|string) (required) The term
to check
- Default: None
- $taxonomy
- (string) (optional) The taxonomy name to
use
- Default: ”
- $parent
- (integer) (optional) $parent ID of parent
term under which to confine the exists search
- Default: 0
Pass the correct arguments and it works.
var_dump(term_exists($name, $taxonomy_name));
0
is the default, so you don’t need to specify it.
Related Posts:
- Insert terms for custom taxonomy on plugin activation, or each page load (init hook)
- How to Get Current Custom Post Type Associated Taxonomy Term
- How to remove plugin-specific custom taxonomy terms when plugin is uninstalled?
- add_action priority and taxonomy used in plugin
- How to display custom taxonomy and terms using/creating plugin template
- What’s the difference between term_id and term_taxonomy_id
- Inserting Taxonomy Terms During a Plugin Activation?
- How to Make a Category Always Selected?
- Rewrite Point Doesn’t Work on Custom Taxonomy
- can I prevent WP users (even admin) from deleting custom categories?
- If a function requires add_action(‘init’) how can I run it only once on plugin activation?
- Get Objects While Deleting term
- Custom plugin: Loop through taxonomy types and update columns for all types?
- Custom Taxonomy to dropdown box on adminside wordpress
- $_FILES empty on created_{taxonomy} and create_{taxonomy} yet is is not on edit_{taxonomy}
- Notice: Trying to get property ‘term_id’ of non-object
- Why is the WordPress taxonomy not registering?
- Translate slug in WPMU with PO files
- Ordering taxonomies by rank
- wp_get_post_terms Order by not working
- Ajax is not working in a loop
- Taxonomies within plugin invalid
- Let plugin check if taxonomy is already registered by another plugin
- Non editable custom taxonomy
- modify show UI of a registered taxonomy
- How add default term meta to prevent an error?
- How to create taxonomy without using register_taxonomy () function
- Add location tag to wordpress posts
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- Add default custom taxonomy to plugin activation
- Javascript not being loaded only in custom taxonomy template
- set a custom post type to a taxonomy term programmatically in metabox
- Making Woocommerce optimized for more than 500k products
- Is there better way to do this without duplicating queries?
- edit-tags.php in plugin admin menu hides when is the active page
- Get term_id for each instance of custom taxonomy
- How to show custom taxonomy child posts through shortcode in WordPress
- If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]
- Is the only way to add taxonomy terms via an admin panel?
- WordPress Breadcrumb Taxonomy Display
- How to boost WP custom post REST API GET queries by custom taxonomies
- WP 3.3 How to Add Menu Items to the Admin Bar?
- Unit tests – Dealing with dependencies
- Changing Plugin Load Order
- Should I create a theme or a plugin?
- How should you hook a session_start() when authoring a plugin?
- Get value in custom field with taxonomy [closed]
- Modify Term Update Redirection
- How to change wordpress post title?
- Separate Custom Post Type Taxonomy by Comma
- How to properly modify get_userdata in plugin to get roles to update in database
- Create a plugin to change the action to which a function is hooked
- Why is the reset password key missing in the reset password email?
- Paging on a future post loop?
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- How to show large image in checkout page using WP Ecommerce plugin [closed]
- Why do I need to check if wp_nonce_field() exists before using it
- how to make custom bulk actions for a WP_List_Table (core class)
- Get name and email of current unregistered user, who has recently submitted name and email in comment form?
- Get Current Custom Taxonomy ID by Post ID
- How to associate an existing user to a site in a multisite setup programmatically
- Auto save permalink setting page with the plugin activation
- creating custom function to log actions in plugin
- Howto: Use Custom Post Types as Submenu Items in Admin
- Show custom data instead of 404
- Which post does a taxonomy term belongs to?
- How can I get a list of CPT inside a plugin file?
- Creating a custom Gutenberg block with columns
- Serve text/html from wp-json API via WPEngine, headers not being set properly
- Add a new confirmation page before saving
- Plugin is not generating title tags on any pages or posts
- Plugin Development/ Stop CSS clashes.
- Add child pages to submenu automatically
- Creating multiple wp_editer() text fields in for loop — the text/visual switch only works for first editor
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- Set term on an attachment using wp_set_object_terms and want to display the full term text but it’s showing a slug instead
- Woocommerce inventory [closed]
- Is there any way to fire heartbeat API from for website visitors?
- how to get term id from current post type instead of name
- How can I prevent ‘500 internal server error’ because of a long install process?
- Displaying custom content from a plugin within the active theme
- Custom plugin & calling REST api of wordpress instance the plugins is running on
- Add variables from rewrite rules to query var
- How do I specify where to save the debug.log?
- Cloning product not copying custom taxonomies
- Code for cron to delete posts that contain specific expression (e.g. “unable to fetch” every 30 minutes
- How to fetch the post content from the wordpress editor before it can be saved(published)?
- pull data from wordpress database
- How does one set cookies in WordPress without getting the ‘headers not sent’ error? within WP
- Glyphicons Dont Show in WordPress Plugin Only
- Change the search results header from plugin
- Get a list of categories ids
- Virtual Page with Registration form
- Is there such a thing as a WordPress console?
- Checking if the query is empty does not work
- Remove default wordpress roles
- What is the meta_query key name for the woo product average rating? [closed]
- how to catch a data from a array in WordPress
- Why my admin-ajax url returns 0 even after adding echo and die() at the end of function?
- External api call using wordpress