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