Browse: Home / Hooks /

ld_course_list_shortcode_attr_values

apply_filters( 'ld_course_list_shortcode_attr_values',  array $atts,  array $attr )

Filters course list shortcode attribute values.


Description #


Parameters #

$atts

(array) Combined and filtered attribute list.

$attr

(array) User defined attributes in shortcode tag.


Source #

File: includes/shortcodes/ld_course_list.php


Examples #

Note: Extended code example below not guaranteed, you may need to consult with a developer

 <?php
/**
 * Example usage for ld_course_list_shortcode_attr_values filter.
 */
add_filter(
	'ld_course_list_shortcode_attr_values',
	function ( $atts = array() ) {
		if ( ( isset( $atts['post_type'] ) ) && ( 'sfwd-courses' === $atts['post_type'] ) ) {
			if ( ! isset( $atts['post__in'] ) ) {
				// Limit courses to specific course post ID. This value
				// must be an array of comma seperated IDs.
				// Example array( 123, 456, 789 )
				$atts['post__in'] = array( 88 );
			}
		}

		// Always return $atts;
		return $atts;
	}
);