First, you can’t enter such expression as second argument in get_term()
. Enter directly the name of your taxonomy…
Are you dealing with simple post categories? If that’s the case, your taxonomy name is 'category'
.
$context['single_term'] = get_term( $user_terms_array[1], 'category' );
Second, ensure that $user_terms_array
contains term IDs as integer.
$user_terms_array = array_map( 'intval', explode( '-', $user_terms ) );
Then, you’re on the good way. Using WP_Term_Query
instead of get_term()
wouldn’t give you any pros if I refer to the supplied info. In this context, I’d stick with get_term()
.
Related Posts:
- Add custom taxonomy fields when creating a new taxonomy
- Remove Category description textarea
- Multi-select field for Taxonomy can’t save the value
- WordPress implode & wp_insert_post question
- Loop through custom taxanomy in post and display custom fields from posts
- Custom field with terms from another taxonomy programmatically
- Dropdown (with onChange) with custom taxonomies
- ACF Custom field not showing in Timber Taxonomy page
- Register custom taxonomy from a Advenced custom field option page
- add custom fields in custom taxonomy meta box in wordpress-3.5.2
- Any way to make custom taxonomy field searchable?
- How do I create a term for every value of a post meta?
- Using wp_query is it possible to orderby taxonomy?
- Is ACF being a honey trap? [closed]
- How to use taxonomies on attachments with the new Media Library?
- How to add images to taxonomies?
- Can you add the visual editor to the description field for custom taxonomies?
- Check if a post has any term in this custom taxonomy?
- custom post type taxonomy “tag” archive : no post found
- Contact Form 7 – Populate Select List With Taxonomy [closed]
- How to display custom taxonomies in posts?
- Get taxonomy names by post id
- Creating Custom Taxonomy without mapping to any post type
- Why is my working Custom Taxonomy not in get_taxonomies array?
- How to modify the query in taxonomy-custom.php to sort term archives by a custom meta field?
- Custom taxonomy hide meta box but show in menu
- display posts with same taxonomy term
- Get value in custom field with taxonomy [closed]
- Exclude specific slug in ‘get_terms’
- wp_insert_term – parent & child problem
- Custom Taxonomy Template Post List with Sort Order
- Is there a way to disable a term rather than deleting it?
- Widget to display custom taxonomy tag cloud
- Modify Term Update Redirection
- Hook to process a new taxonomy tag before it is created?
- Return only the custom sub-term for custom post type, do not echo term-parent
- Get total number of comments from posts in a specific custom taxonomy
- Custom taxonomy on permalink
- Check if current term is a child of another term
- Custom hierarchal taxonomy loses interface hierarchy when selecting parent & children
- get_terms() doesn’t return empty terms even though hide_empty is false
- How do I filter posts by taxomony using AJAX
- SQL QUERY needed to get POST category (taxonomy) ? – MUST be SQL statement
- Formating the_terms() function output
- Archive template for taxonomy terms
- Multiple users – only allow them to manage their own terms for custom taxonomy when logged in
- Custom taxonomy on users with UI
- How to return a list of custom taxonomy terms via the Gutenberg getEntityRecords method
- Create taxonomy with meta term using the WP Rest Api
- Custom metabox for menu administration page?
- wp_options table value
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- How can I set up a category “overview” page?
- Custom Fields and performance
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- register_rest_field for custom taxonomy fields that are assosiated with custom post type
- Sort posts by number of matched terms
- Get current term’s ID
- Is it possible to get a Previous/Next Taxonomy term archive URL?
- Is it possible to sort the post based on a custom field?
- Custom taxonomy – custom sortable column
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Taxonomy Relationships
- How to display submenus on page based on referring top-level parent?
- Possible to register multiple custom taxonomies in one function?
- How to get the top most term (top ancestor) of a custom taxonomy child term?
- Taxonomies not appearing in columns on dashboard
- Combine multiple custom user taxonomy in single url
- How to modify default taxonomy field to a single text field?
- Add custom taxonomy to default category taxonomy?
- How to set hierarchical terms to a post using wp_set_object_terms
- Echo taxonomy term meta on author.php
- Hierarchical display of custom taxonomy
- How do I display a tag cloud with both post tags AND a custom taxonomy?
- Adding session variable and/or cookie based on user-selected input
- How to output the taxonomy term name in a widget
- How to link categories to custom taxonomy terms?
- List taxonomy / category count showing list published posts only
- How to display term description in empty terms archive?
- Advanced Tax Query
- Display sub-taxonomies based on SELECTED parent-taxonomy
- Checking if a Page has an Associated Term?
- How get custom field from custom taxonomy?
- Save Filter for Taxonomies
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Automatically assign taxonomy term if custom meta value exists
- Function to limit the number of posts in taxonomy.php
- Create Child Taxonomies
- Is It Possible To Have Shared WordPress Custom Post Types?
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- WordPress renames slug of tags used in multiple taxonomies?
- Get terms ordered by post date
- User role permissions based on taxonomies
- Allow only 1 instance of each term in each custom taxonomy
- How to add custom field to custom taxonomy in 4.4
- WP Query with custom taxonomy
- how to search in custom fields & custom taxonomy for custom search
- Query Posts by taxonomy/Taxonomy Child Custom order
- How to prevent posts duplicating when viewing a custom taxonomy term
- Getting yoast title for custom taxonomy