This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert the post content to UTF-8 in WPYTHub importer. | |
*/ | |
add_action( | |
'cbc_video_post_content', | |
function( $content ){ | |
if( function_exists( 'mb_convert_encoding' ) ) { | |
$content = mb_convert_encoding( $content, 'UTF-8', 'auto' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Enable auto captions on video embeds. | |
*/ | |
add_filter( | |
'vimeotheque\player\embed-parameters', | |
function( $embed_options ){ | |
if( !is_array($embed_options) ){ | |
$embed_options = array(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( | |
'init', | |
function() { | |
/** | |
* Remove UI. | |
* | |
* Remove UI for Vimeotheque custom post type taxonomies. | |
* | |
* @param array $args Array of arguments for registering a taxonomy. | |
* @param string $taxonomy Taxonomy key. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change page title. | |
* | |
* Change the page title for post type "vimeo-video" when displaying the post type archive. | |
* | |
* @param string $title The post title. | |
* @return string | |
*/ | |
add_filter( | |
'pre_get_document_title', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Store video URL on post meta. | |
*/ | |
add_action( | |
'vimeotheque\import_success', | |
function( $post_id, $video ){ | |
$post = get_post( $post_id ); | |
if( $post && 'portfolio-item' == $post->post_type ) { | |
update_post_meta( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Import videos as post type "portfolio-item". | |
*/ | |
add_filter( | |
'vimeotheque_pro\post\import_post_type', | |
function(){ | |
return 'portfolio-item'; | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Remove file extension if shown into the title retrieved from Vimeo. | |
*/ | |
add_filter( | |
'vimeotheque\import_post_title', | |
function( $title ){ | |
return str_replace( '.mp4', '', $title ); | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Declare theme support for Vimeotheque templates. | |
*/ | |
add_theme_support( 'vimeotheque' ); | |
/** | |
* Declare theme support for Vimeotheque video playback end card. | |
*/ | |
add_theme_support( 'vimeotheque-next-video-card' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* When using the WP Loop block, the post being displayed into the loop doesn't have the same ID with the main post/page | |
* that the WP Query is displaying. To avoid not having the embeds skipped, the the filter to skip the post ID check to (bool) true. | |
*/ | |
add_filter( | |
'cvwp_image_embed_skip_post_check', | |
'__return_true' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add 'download' field to API response | |
* | |
* @param array $fields Additional fields allowed in API response | |
* | |
* @return array | |
*/ | |
function vmtq_addon_add_dist_links( $fields ){ | |
$fields[] = 'download'; | |
return $fields; |
NewerOlder