- Timestamp:
- 07/07/2015 06:05:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/functions.php
r1557 r1712 469 469 remove_filter( 'the_content', array( $this, 'remove_shortcodes' ) ); 470 470 471 preg_match_all( '/\[wpvideo +([a-zA-Z0-9,\#,\&,\/,;,",=, ]*?)\]/i', $post->post_content, $matches ); 472 foreach ( $matches[1] as $key => $code ) { 473 474 preg_match( '/([0-9A-Za-z]+)/i', $code, $m ); 475 $guid = $m[1]; 476 477 $image = video_image_url_by_guid( $guid, 'fmt_dvd' ); //dvd image has width = 640 478 $video = apply_filters( 'the_content', '[wpvideo ' . $guid . ' w=605]' ); 479 480 /* 481 // Comment out the $video= line above and uncomment the following code to enable Unisubs 482 $permalink = get_permalink( $post->ID ); 483 $video = <<<HTML 484 <script type="text/javascript" src="http://unisubs.example.com:8000/site_media/embed.js"> 485 ({ 486 "video_url": "$permalink", 487 "video_config": { 488 "width": 648, 489 "height": 425 490 } 491 }) 492 </script> 493 HTML; 494 $video .= apply_filters( 'the_content', '' );*/ 495 } 496 471 // VideoPress 472 preg_match_all( '/' . get_shortcode_regex() . '/s', $post->post_content, $shortcodes, PREG_SET_ORDER ); 473 foreach ( $shortcodes as $shortcode ) { 474 if ( 'wpvideo' == $shortcode[2] ) { 475 $attributes = shortcode_parse_atts( $shortcode[0] ); 476 $image = video_image_url_by_guid( rtrim( $attributes[1], ']' ), 'fmt_dvd' ); // dvd image has width = 640 477 $video = sprintf( '[%s %s w="605"]', $shortcode[2], trim( $shortcode[3] ) ); 478 $video = apply_filters( 'the_content', $video ); 479 } 480 } 481 482 // SlideShare 497 483 preg_match_all( '|\[slideshare (.+?)]|ie', $post->post_content, $matches ); 498 484 foreach ( $matches[1] as $key => $code ) { … … 511 497 } 512 498 499 // VodPod 513 500 preg_match_all( '|\[vodpod (.+?)]|ie', $post->post_content, $matches ); 514 501 foreach ( $matches[1] as $key => $code ) { … … 521 508 } 522 509 510 // Output results 523 511 if ( $thumb ) { 524 512 if ( ! $no_html ) { … … 529 517 echo $video; 530 518 } 519 531 520 add_filter( 'the_content', array( $this, 'remove_shortcodes' ) ); 532 521 }
Note: See TracChangeset
for help on using the changeset viewer.