LLMS_Post_Model::get_embed( string $type = 'video', string $prop = '' )

Get media embeds


Parameters Parameters

$type

(string) (Optional) Embed type [video|audio]. Default is 'video'.

Default value: 'video'

$prop

(string) (Optional) Postmeta property name. Default is empty string. If not supplied it will default to {$type}_embed.

Default value: ''


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/abstracts/abstract.llms.post.model.php

	protected function get_embed( $type = 'video', $prop = '' ) {

		$ret = '';

		$prop = $prop ? $prop : $type . '_embed';
		$url  = $this->get( $prop );
		if ( $url ) {

			$ret = wp_oembed_get( $url );

			if ( ! $ret ) {

				$ret = do_shortcode( sprintf( '[%1$s src="%2$s"]', $type, $url ) );

			}
		}
		/**
		 * Filters the embed html
		 *
		 * The first dynamic portion of this hook, `$this->model_post_type`, refers to the model's post type. For example "course",
		 * "lesson", "membership", etc...
		 * The second dynamic portion of this hook, `$type`, refers to the embed type [video|audio].
		 *
		 * @since Unknown
		 *
		 * @param array           $embed     The embed html.
		 * @param LLMS_Post_Model $llms_post The LLMS_Post_Model instance.
		 * @param string          $type      Embed type [video|audio].
		 * @param string          $prop      Postmeta property name.
		 */
		return apply_filters( "llms_{$this->model_post_type}_{$type}", $ret, $this, $type, $prop );

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.17.5 Unknown.
3.17.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.