learndash_course_builder_selector_args

apply_filters( 'learndash_course_builder_selector_args',  array $args )

Filters course builder query arguments.


Description #


Parameters #

$args

(array) An array of query arguments.


Source #

File: includes/admin/classes-builders/class-learndash-admin-course-builder-metabox.php


Examples #

 <?php
/**
 * Example usage for learndash_course_builder_selector_args filter.
 */
add_filter(
	'learndash_course_builder_selector_args',
	function ( $query_args = array() ) {
		if ( ( isset( $query_args['meta_query'][0] ) ) && ( ! empty( $query_args['meta_query'][0] ) ) ) {
			foreach ( $query_args['meta_query'][0] as $mq_idx => $mq ) {
				if ( ( isset( $mq['compare'] ) ) && ( 'NOT EXISTS' == $mq['compare'] ) ) {
					unset( $query_args['meta_query'][0][ $mq_idx ] );
				}
			}
		}

		// Aways return $query_args.
		return $query_args;
	}
);