-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.php
More file actions
35 lines (31 loc) · 998 Bytes
/
main.php
File metadata and controls
35 lines (31 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/*
* Plugin Name: Vimeo Videos - single video embed shortocde
* Plugin URI: https://codeflavors.com/vimeo-video-post/
* Description: Adds shortcode "cvm_embed_video_shortcode" to plugin Vimeo Video Post that allows embedding the video in video posts into a certain position.
* Author: CodeFlavors
* Version: 1.0
* Author URI: https://codeflavors.com
*/
if( !function_exists( 'cvm_embed_video_shortcode' ) ) {
/**
* Shortcode callback that displays the video into a video post into
* the exact position where the shortode is.
* @return string|void
*/
function cvm_embed_video_shortcode() {
if( !function_exists( 'cvm_is_video' ) ){
return;
}
if ( ! is_singular() || ! cvm_is_video() ) {
return;
}
global $post;
return cvm_get_video_embed_html( $post, false );
}
add_shortcode( 'cvm_video_embed', 'cvm_embed_video_shortcode' );
}
/**
* Prevent Vimeo Video Post from embedding automatically
*/
add_filter('cvm_automatic_video_embed', '__return_false');