Completed
Pull Request — master (#1451)
by Naveen
01:02
created
src/wordlift/videoobject/filters/class-jw-player-capture.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -13,33 +13,33 @@
 block discarded – undo
13 13
 
14 14
 class Jw_Player_Capture {
15 15
 
16
-	public function init() {
17
-		add_filter( 'wl_videoobject_embedded_videos', array( $this, 'wl_videoobject_embedded_videos' ), 10, 2 );
18
-	}
16
+    public function init() {
17
+        add_filter( 'wl_videoobject_embedded_videos', array( $this, 'wl_videoobject_embedded_videos' ), 10, 2 );
18
+    }
19 19
 
20 20
 
21
-	public function wl_videoobject_embedded_videos( $embedded_videos, $post_id ) {
22
-		// we cant reliably determine count for external plugin without
23
-		// this method.
24
-		global $wpdb;
25
-		$post_meta_table_name = $wpdb->postmeta;
26
-		$query_template = <<<EOF
21
+    public function wl_videoobject_embedded_videos( $embedded_videos, $post_id ) {
22
+        // we cant reliably determine count for external plugin without
23
+        // this method.
24
+        global $wpdb;
25
+        $post_meta_table_name = $wpdb->postmeta;
26
+        $query_template = <<<EOF
27 27
 SELECT meta_value FROM $post_meta_table_name WHERE meta_key LIKE '_jwppp-video-url-%' AND post_id=%d
28 28
 EOF;
29
-		$query                = $wpdb->prepare( $query_template, $post_id );
30
-		$video_ids            = $wpdb->get_col( $query );
31
-		if ( ! $video_ids ) {
32
-			return $embedded_videos;
33
-		}
29
+        $query                = $wpdb->prepare( $query_template, $post_id );
30
+        $video_ids            = $wpdb->get_col( $query );
31
+        if ( ! $video_ids ) {
32
+            return $embedded_videos;
33
+        }
34 34
 
35
-		var_dump(get_post_meta( $post_id, '_jwppp-video-url-1'));
35
+        var_dump(get_post_meta( $post_id, '_jwppp-video-url-1'));
36 36
 
37
-		$jw_player_videos = array_map( function ( $video_id ) {
38
-			return new Default_Embedded_Video( 'https://cdn.jwplayer.com/v2/media/' . $video_id );
39
-		}, $video_ids );
37
+        $jw_player_videos = array_map( function ( $video_id ) {
38
+            return new Default_Embedded_Video( 'https://cdn.jwplayer.com/v2/media/' . $video_id );
39
+        }, $video_ids );
40 40
 
41
-		return array_merge( $embedded_videos, $jw_player_videos );
42
-	}
41
+        return array_merge( $embedded_videos, $jw_player_videos );
42
+    }
43 43
 
44 44
 
45 45
 }
46 46
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 class Jw_Player_Capture {
15 15
 
16 16
 	public function init() {
17
-		add_filter( 'wl_videoobject_embedded_videos', array( $this, 'wl_videoobject_embedded_videos' ), 10, 2 );
17
+		add_filter('wl_videoobject_embedded_videos', array($this, 'wl_videoobject_embedded_videos'), 10, 2);
18 18
 	}
19 19
 
20 20
 
21
-	public function wl_videoobject_embedded_videos( $embedded_videos, $post_id ) {
21
+	public function wl_videoobject_embedded_videos($embedded_videos, $post_id) {
22 22
 		// we cant reliably determine count for external plugin without
23 23
 		// this method.
24 24
 		global $wpdb;
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
 		$query_template = <<<EOF
27 27
 SELECT meta_value FROM $post_meta_table_name WHERE meta_key LIKE '_jwppp-video-url-%' AND post_id=%d
28 28
 EOF;
29
-		$query                = $wpdb->prepare( $query_template, $post_id );
30
-		$video_ids            = $wpdb->get_col( $query );
31
-		if ( ! $video_ids ) {
29
+		$query                = $wpdb->prepare($query_template, $post_id);
30
+		$video_ids            = $wpdb->get_col($query);
31
+		if ( ! $video_ids) {
32 32
 			return $embedded_videos;
33 33
 		}
34 34
 
35
-		var_dump(get_post_meta( $post_id, '_jwppp-video-url-1'));
35
+		var_dump(get_post_meta($post_id, '_jwppp-video-url-1'));
36 36
 
37
-		$jw_player_videos = array_map( function ( $video_id ) {
38
-			return new Default_Embedded_Video( 'https://cdn.jwplayer.com/v2/media/' . $video_id );
39
-		}, $video_ids );
37
+		$jw_player_videos = array_map(function($video_id) {
38
+			return new Default_Embedded_Video('https://cdn.jwplayer.com/v2/media/'.$video_id);
39
+		}, $video_ids);
40 40
 
41
-		return array_merge( $embedded_videos, $jw_player_videos );
41
+		return array_merge($embedded_videos, $jw_player_videos);
42 42
 	}
43 43
 
44 44
 
Please login to merge, or discard this patch.