Change default object parameters

Here is an example of how to change the source of the Video object. Add this code to your theme (functions.php file) or to your custom plugin


function my_custom_mp_library($motopressCELibrary) {
// get Video from the library
$videoObj = &$motopressCELibrary->getObject('mp_video');
if ($videoObj) {
$videoObj->parameters['src']['default'] = 'https://www.youtube.com/watch?v=3znnKsAp1J4';
}
}
add_action('mp_library', 'my_custom_mp_library', 10, 1);

Don’t forget to place your video URL instead of the sample one.

Related Topics

Leave a Reply

Your email address will not be published. Required fields are marked *