I managed to solve this issue using pre_get_terms
as an action and then updating the query_vars
$current_user = get_current_user_id();
$user_field = "user_".$current_user;
$user_categories = get_field('post_categories', $user_field);
if(in_array('category',$terms->query_vars['taxonomy'])){
$terms->query_vars['include'] = $user_categories;
}
return $terms;
Related Posts:
- Replace category titles
- How to hide category name
- How to hide a category or tag everywhere EXCEPT for use with get_posts
- Replace category titles inside RSS feed
- Hook when category is added to post
- Filter categories using tags
- Woocommerce Product Category Widget – hide categories that have no products in stock [closed]
- Make parent categories not selectable
- Send an email when custom post type category is changed
- what is the action hook code to supporting product category condition in single product page of woocommerce?
- Add custom category name as data-filter to switch between these categories
- Remove word “Category” from WooCommerce product page [closed]
- Can paginate_links() be customized for a specific category or tag?
- Filtering by Category doesnt paginate correctly on the backend
- Dropdown category filter
- Make parent category not selectable when it has child categories
- Hide posts of a certain category unless logged in
- functions.php conditional tag – only show in single.php?
- What’s the Simplest Way to Override/Rewrite the %category% Permalink Structure Tag?
- Set the default category of an attachment
- How to Filter categories in the permalink structure
- How to display posts under a specific subcategory of a given category
- Taxonomy filter all children
- Filter Home Page Posts in Buddypress [closed]
- Categorising posts/pages into years published
- Highlight “Show all” item in wp_list_categories
- Inserting Category programmatically
- Automatically set default password to all posts in a specific category
- get_the_categories filter returns an empty array
- category filter doesn’t work in WPML
- Query posts from category based on a filter most favorited
- Filter Categories in meta box for CPTs
- Assign category from custom field on post creation and update
- Show only first category name in RSS?
- How to organize custom categories for filtering and selecting
- Filter $cpt categories to omit certain category
- How to set a filter by category within a customised page
- Refine/Filter the Search Results by Category
- Admin comments and user restrictions
- WordPress Post # of # filtered by category slug
- Pagination for ajax category filter
- ajax for filtering posts by category in wordpress loops
- How to customize category_description()?
- Categories widget show empty?
- How to make the ‘delete’ button inactive on some categories?
- Overriding default calendar to show posts from a category
- How can I display tags as categories?
- Display all product tags associated with a specific product category
- How to access deleted term inside delete_product_cat action
- Filter WooCommerce archive pages by an additional category
- Portfolio Filter Buttons Wont Work
- “Virtual category page” based on a custom field filter
- Custom tax_query filter not working for Woocommerce product categories
- How to hide some categories in dashboard
- Change post title if post has specific category
- Filter By Category Dropdown List With Custom Taxonomies
- How can I filter posts by tag on the fly
- Change Default Content when Creating a Post based on Previous Category Choice
- Maintaining a separate posts page for certain categories and don’t show those on home page
- Exclude posts without category from loop
- How to filter post from categories only if the posts appears in one of them, not the other?
- How to fix select filter on category
- wp_dropdown_categories() works correctly but the list is not filtered in admin for custom post type. What is the problem?
- Add $args to wp_list_categories
- Add filter for specific category only
- How to create category filter on a blog like on the site below?
- How to filter tags by category?
- Custom Taxonomy Isotope Grid – Filter Buttons Not Working
- How to exclude a category returned by get_categories from function.php?
- Can’t display posts by filtering categories using isotope.js
- Restrict retrieved terms by category?
- How to delete WooCommerce categories in bulk that only have one product
- Ajax Category add doesn’t update the list table custom column
- How to hook into creating a category?
- Hiding by default posts in given category except for some cases
- Remove “Category:”
- ACF Gallery with Media Categories – how do display categories and sort
- Custom filters inside a specific category?
- get categories the post was in and just been removed from
- filter single_cat_title avoiding the breadcrumbs
- Right way for setting categories
- Custom built theme won’t filter categories
- category filter doesn’t work
- How to display the category featured images [closed]
- Hook action when create new category [duplicate]
- How to create a photo gallery that can be filtered by the image categories
- Remove “?category=” in the URL wordpress ajax filter work for category
- Gutenberg editor add a custom category as wrapper for custom blocks
- Category Archive, list subcategories of each post
- Remove Parent Category from Child Category URL
- Allow users to post to a certain category
- Link Attachment Image to Category
- Get all media categories
- Custom SQL Query: Get all posts with category id and a concated list of tags on each post
- Link from navbar to categories
- Custom menu with categories and tags
- How to get the_category(‘, ‘) with link “title” attribute
- product_cat image url from database
- Show parent-child relationship for categories in the wordpress admin
- How to assign different categories to pages in wordpress?