Front_End::init()
Init action callback.
Description
Will set all filters and actions needed by the plugin to do embeds and perform front-end tasks. Used for internal purposes, should not be called manually.
Source
File: includes/libs/front-end.class.php
public function init(){
$this->embed_filter_priority = intval(
/**
* Automatic video embedding in post content filter priority.
*
* @param int $priority The "the_content" filter priority used to automatically embed the video into the post content.
*/
apply_filters(
'vimeotheque\embed_filter_priority',
$this->embed_filter_priority
)
);
// filter content to embed video
add_filter( 'the_content', [
$this,
'embed_video'
], $this->embed_filter_priority, 1 );
// add player script
add_action( 'wp_print_scripts', [
$this,
'add_player_script'
] );
add_action( 'post_thumbnail_html', [
$this,
'filter_thumbnail_html'
], 10, 2 );
/**
* Template function the_term() works by default only for post_tag taxonomy.
* This filter will add the plugin taxonomy for plugin custom post type
*/
// add this filter only in front-end
if( ! is_admin() ){
add_filter( 'get_the_terms', [
$this,
'filter_video_terms'
], 10, 3 );
}
}
