Created
June 1, 2021 21:25
-
-
Save gdarko/f6627f9604ba96bb04951b248fc5cc78 to your computer and use it in GitHub Desktop.
WP Vimeo Videos - Modify video title before upload (both Vimeo.com and Local video 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
<?php | |
/** | |
* Append date to the video title stored in Media > Library | |
* | |
* @param $args | |
* | |
* @return mixed | |
*/ | |
function dgv_before_create_local_video_params_823842831( $args ) { | |
$args['post_title'] = sprintf( '%s - %s', $args['post_title'], wp_date( get_option( 'date_format' ) ) ); | |
return $args; | |
} | |
add_filter( 'dgv_before_create_local_video_params', 'dgv_before_create_local_video_params_823842831', 20 ); | |
/** | |
* Append date to the video title stored in Vimeo.com | |
* | |
* @param $args | |
* | |
* @return mixed | |
*/ | |
function dgv_before_create_api_video_params_823842831( $args ) { | |
$args['name'] = sprintf( '%s - %s', $args['name'], wp_date( get_option( 'date_format' ) ) ); | |
return $args; | |
} | |
add_filter( 'dgv_before_create_api_video_params', 'dgv_before_create_api_video_params_823842831', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment