ld_video_params

apply_filters( 'ld_video_params',  array $video_params,  string $video_provider,  string $video_content,  WP_POST $post,  array $settings )

Filters post content video parameters.


Description #


Parameters #

$video_params

(array) An array of video parameters.

$video_provider

(string) Name of the video provider.

$video_content

(string) Video content HTML output.

$post

(WP_POST) Post object.

$settings

(array) An array of LearnDash settings for a post.


Source #

File: includes/course/ld-course-video.php


Examples #

 <?php
/**
 * Example usage for ld_video_params filter.
 */
// Override Vimeo show controls setting to always be enabled.
add_filter(
	'ld_video_params',
	function( $settings, $provider ) {
		if ( 'vimeo' === $provider ) {
			// Show video player controls
			$settings['controls'] = 1;
			// Autostart video
			// $settings['autoplay'] = 1;
		};
		// Always return $settings
		return $settings;
	},
	10,
	2
);

add_filter(
	'ld_video_params',
	function ( $video_params = array() ) {
		$video_params['controls'] = true;

		// Always return $video_params
		return $video_params;
	},
	10,
	1
);