Changeset 12044
- Timestamp:
- 09/02/2022 05:27:26 AM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/functions.php
r12042 r12044 47 47 'featured_wordcamps' => __( 'Featured WordCamps', 'wptv' ), 48 48 ) ); 49 50 // MediaRSS 51 // All videos are uploaded by anonvideoupload, we don't need that in the RSS feed. 52 add_filter( 'mrss_avatar_user', '__return_false' ); 53 // Add the original uploaded file to the mediaRss output. 54 add_filter( 'mrss_media', array( $this, 'mrss_media_add_original' ) ); 49 55 } 50 56 … … 788 794 return $locales[ $locale ] ?? false; 789 795 } 796 797 /** 798 * Add the Original uploaded file to the mediaRss output. 799 */ 800 public function mrss_media_add_original( $meds ) { 801 global $post; 802 803 if ( ! function_exists( 'find_all_videopress_shortcodes' ) ) { 804 return $meds; 805 } 806 807 $videos = array_keys( find_all_videopress_shortcodes( $post->post_content ) ); 808 if ( ! $videos ) { 809 return $meds; 810 } 811 812 $video = video_get_info_by_guid( $videos[0] ); 813 $original_url = video_attachment_url( $video ); 814 815 if ( $original_url ) { 816 $meds[] = array( 817 'content' => array( 818 'attr' => array( 819 'medium' => 'video', 820 'isDefault' => 'false', 821 'url' => $original_url, 822 ) 823 ) 824 ); 825 } 826 827 return $meds; 828 } 790 829 } 791 830
Note: See TracChangeset
for help on using the changeset viewer.