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: ''
Return Return
(string)
Source Source
File: includes/abstracts/abstract.llms.post.model.php
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 | 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 ); } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.17.5 | Unknown. |
3.17.0 | Introduced. |