Plugin – Combine Meta Box Input Fields into single saveble record

Use something like this after you foreach loop. In this example link is saved in new meta field. You can overwrite document_overview_document-link, but then you will get combined html code as link value when open your document in editor. foreach { … } if ( isset( $_POST[ ‘document-link’ ] ) ) { $html=”<a class=”btn btn-outline-info … Read more

Associate users with Custom Post Type and list associated users

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’, ), ), … Read more

Custom post taxonomies as tax_query terms?

There is an example of how to do this on the official doc for WP_Query: https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters Specifically, by declaring multiple items in the tax_query and setting their relation: Display posts that are in the quotes category OR have the quote post format: $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘OR’, array( … Read more

WP_Query inside foreach loop returning same value for all options when filtered using ajax

If anyone is interested in how to achieve the result for the question I posted, I managed to work it out! As the correct results we’re being displayed, but for each iteration of the foreach loop rather than the specific day, I managed to get the results to display/hide by using if (is_object_in_term($class->ID, ‘calendar-day’, ‘monday’) … Read more