File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -95,11 +95,11 @@ public function player_enabled() {
9595 * Initialises the Cloudinary player if it's enabled and if video content is found.
9696 */
9797 public function init_player () {
98-
9998 if ( isset ( $ this ->config ['video_player ' ] ) && 'cld ' === $ this ->config ['video_player ' ] && ! is_admin () ) {
99+ global $ wp_query ;
100+ $ posts = $ wp_query ->get_posts ();
100101 // Check content has a video to enqueue assets in correct location.
101- while ( have_posts () ) {
102- the_post ();
102+ foreach ( $ posts as $ post ) {
103103 $ has_video = $ this ->media ->filter ->get_video_shortcodes ( get_the_content () );
104104 $ video_tags = $ this ->media ->filter ->get_media_tags ( get_the_content (), 'video ' );
105105 if ( ! empty ( $ has_video ) || ! empty ( $ video_tags ) ) {
@@ -124,8 +124,6 @@ public function init_player() {
124124 break ; // Exit since we determined that a video is present.
125125 }
126126 }
127- // Reset wp_query.
128- rewind_posts ();
129127 }
130128 }
131129
You can’t perform that action at this time.
0 commit comments