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

51public function init(){
52 
53    $this->embed_filter_priority = intval(
54        /**
55         * Automatic video embedding in post content filter priority.
56         *
57         * @param int $priority The "the_content" filter priority used to automatically embed the video into the post content.
58         */
59        apply_filters(
60            'vimeotheque\embed_filter_priority',
61            $this->embed_filter_priority
62        )
63    );
64 
65    // filter content to embed video
66    add_filter( 'the_content', [
67        $this,
68        'embed_video'
69    ], $this->embed_filter_priority, 1 );
70 
71    // add player script
72    add_action( 'wp_print_scripts', [
73        $this,
74        'add_player_script'
75    ] );
76 
77    add_action( 'post_thumbnail_html', [
78        $this,
79        'filter_thumbnail_html'
80    ], 10, 2 );
81 
82    /**
83     * Template function the_term() works by default only for post_tag taxonomy.
84     * This filter will add the plugin taxonomy for plugin custom post type
85     */
86    // add this filter only in front-end
87    if( ! is_admin() ){
88        add_filter( 'get_the_terms', [
89            $this,
90            'filter_video_terms'
91        ], 10, 3 );
92    }
93}

Start your video site now!

Manage and coordinate your Vimeo channels, albums or videos with your WordPress website. Perfect fit for membership, portfolio, online courses or any type of video collection.

Get Vimeotheque PRO!