| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: VidoRev |
| 4 |
* Plugin URI: http://demo.beeteam368.com/vidorev/ |
| 5 |
* |
| 6 |
* Compatibility Description: Ensures compatibility with VidoRev. |
| 7 |
* |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace wpCloud\StatelessMedia { |
| 11 |
|
| 12 |
if( !class_exists( 'wpCloud\StatelessMedia\VidoRev' ) ) { |
| 13 |
|
| 14 |
class VidoRev extends ICompatibility { |
| 15 |
protected $id = 'VidoRev'; |
| 16 |
protected $title = 'VidoRev'; |
| 17 |
protected $constant = 'WP_STATELESS_COMPATIBILITY_VIDOREV'; |
| 18 |
protected $description = 'Ensures compatibility with VidoRev.'; |
| 19 |
protected $plugin_file = [ 'vidorev-extensions/vidorev-extensions.php' ]; |
| 20 |
|
| 21 |
public function module_init( $sm ) { |
| 22 |
add_filter( 'vidorev_single_video_url', array( $this, 'vidorev_single_video_url' ), 10, 2 ); |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* Syncing the video file. |
| 27 |
* |
| 28 |
* @param $url |
| 29 |
* @param $post_id |
| 30 |
* @return mixed |
| 31 |
*/ |
| 32 |
public function vidorev_single_video_url( $url, $post_id ) { |
| 33 |
$attachment_id = attachment_url_to_postid( $url ); |
| 34 |
Utility::add_media( null, $attachment_id ); |
| 35 |
return $url; |
| 36 |
} |
| 37 |
|
| 38 |
} |
| 39 |
|
| 40 |
} |
| 41 |
|
| 42 |
} |
| 43 |
|