Advertisement
phpface

Untitled

Apr 5th, 2022
1,353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. /**
  2.  *
  3.  * Filter videojs player tag output, before player rendered.
  4.  *
  5.  * @param string $player
  6.  * @param array $setup
  7.  * @param string|int $source
  8.  *
  9.  */
  10. add_filter( 'streamtube/player/file/output', function( $player, $setup, $source ){
  11.  
  12.     // Enqueue some JS/CSS ... etc
  13.    
  14.     if( wp_attachment_is( 'video', $source ) ){
  15.  
  16.         $player = 'Your custom player tag goes here';
  17.     }
  18.  
  19.     return $player;
  20.  
  21. }, 100, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement