You have to create a custom taxonomy:
add_action( 'init', function(){
register_taxonomy( 'program', 'your_post_type', array() );
});
To get users associated with a program, get all posts that have your desired program term:
$query = new WP_Query( array(
'post_type' => 'your_post_type',
'tax_query' => array(
array(
'taxonomy' => 'program',
'field' => 'name',
'terms' => 'your_program_name',
),
),
) );
Now get all the result posts authors and that would give you the users associated to that specific program.
$posts = $query->posts;
foreach($posts as $post) {
$author = $post->post_author;
}
Related Posts:
- How do I get the permalink of a custom post type?
- Row actions for custom post types?
- How to set parent-child relationship between differents custom post types
- Add Custom Fields to Custom Post Type RSS
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Restrict custom post type to only site administrator role
- Add content in custom post type page after the title and before columns
- get attachments for all posts of particular post type
- Check if a custom taxonomy archive page is being displayed
- How to limit the number of terms (terms acts like categories)
- Removing custom post type from link search results
- How to add a post from a custom post type as the static page?
- How can I get next/ previous post links to order by a filter (by the last word of the title)?
- How do I Make a custom post type get a custom post template in a plugin
- Check if current user has post in post type and is author role
- Priority for Categories, Tags, Taxonomies, Posts, Pages and Custom Posts with same url
- Using Custom Meta Capabilities on Custom Post Type
- Separating Search Results By Post Type
- Set default option in dropdown of WP_Query?
- How can I programmatically save data into custom fields that contain serialized data?
- Custom Post Types: Custom columns with Title submenu?
- Automatically Insert Custom Field on Custom Post Type Publish
- register multiple post types on one menu entry
- Create XML files on post edit screen
- Changing sort order with pre_get_posts using is_post_type_archive doesn’t change category pages
- Creating a custom post type using a object oriented approach?
- CPT Search Form with Taxonomy filter & Or
- how to add extra GET parameters to post to url with add_rewrite_rule?
- How to use the Display Name as the post title in a custom post type?
- Removing parent slug in hierachial custom post type
- CPT + CMB2: data not displaying for only first post in loop
- Remove edit or add facility for custom post type
- Why doesn’t a custom post type permalink ever hit index.php
- Random image from tag/custom type on sidebar
- Set a maxlength for the title input in a custom post type
- Custom WP Query on custom meta and sort by multiple meta keys value
- Woocommerce search pagination not working
- Completely remove custom post type permalinks (“One Page” website)
- Post ID randomly printing on page
- WordPress custom post type split into pages
- Correct procedure for advanced permalinks
- Permalinks: custom post type -> custom taxonomy -> post
- How do i search authors from search form using author’s name
- Custom Post Types hierarchy and rewrite
- Custom permalinks rules don’t match and lost of query var in the process
- Facebook social publisher and custom post type fields [closed]
- How can I set the page template of a new custom post type post?
- Suggestion on custom post type/ taxonomy relationship
- Querying custom post type twice on same page
- How to Create Template File for Parent Page of Custom Post Type
- WordPress Picks Up Wrong Template for Custom Post Type Archive Page
- How to hyperlink content from archive page with custom post-type
- Custom post type showing same Post on all Pages
- Should I use custom taxonomies or not?
- get comments by current user inside page template
- get parent content inside child posts
- How to get specific post meta by title or id
- display custom taxonomies limited to custom post type?
- Populate a custom field dropdown with post titles by author
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Use core block functionality in a custom block gutenberg
- List Custom Post Types in Admin Dashboard
- CPT Archive pre_get_posts not working?
- How do I show a link or ‘Read More’ button on a custom field excerpt when it is less than the word limit
- Hide text if query has no posts
- Multiple custom post types showing up in edit.php
- “Cannot redeclare cpt_reg_tax()” because of functions.php
- Am I mixing up the concept of posts pages and categories?
- Writing a custom Glossary plugin
- How to show Custom Post Types under Taxonomy in a new WordPress page template?
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- Custom Post Type Category Displaying ALL Sub Categories as well
- Feature image Gallery made from Custom Post type + Categories
- Custom post type in slider front page Breaking layout
- register_rest_field update_callback don’t work for $_FILES
- Change the term based on the value of a $variable using wp_update_post in submitting a form
- Getting data from dynamically allocated metaboxes within a custom post
- Meta query broken since 4.7.4 Update
- Custom post type , page template not grabbing the page template
- Can I organise my custom post types by page?
- Display posts of a hierarchical custom post type excluding parent posts
- Best Plugins for Complex Index of Resources [closed]
- How Can a CPT in WordPress have a page 2 without an error?
- Get the custom post type slug but remove the rewrite prefix?
- Remove sequential number from permalinks
- custom post type archive slug vs. custom page template
- Site loads very slow for archive custom post type page
- WordPress loop for multiple custom post types
- how to add pagination and post query in taxonomy-taxonomy-term.php? [duplicate]
- Pagination not working with custom loop
- How to bring custom meta boxes to custom post types?
- Switched server & domain name, now custom post types won’t save
- Display one post based on ID from $_GET
- Don’t display post if post has empty body
- Posts picking up old Permalinks, how to reset?
- Custom Post Type to Plugin
- How to query posts by category with the_title();
- Allow child pages with the same base as the CPT slug
- upload image with rest API to the media library
- WordPress post objects in one parent post object