@@ -37,7 +37,9 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function render() |
| 39 | 39 | { |
| 40 | - if( !isset( $this->video->html ))return; |
|
| 40 | + if( !isset( $this->video->html )) { |
|
| 41 | + return; |
|
| 42 | + } |
|
| 41 | 43 | return sprintf( |
| 42 | 44 | '<div class="video embed">%s%s</div>', |
| 43 | 45 | $this->renderScreenshot(), |
@@ -61,7 +63,9 @@ discard block |
||
| 61 | 63 | |
| 62 | 64 | public function renderScreenshot() |
| 63 | 65 | { |
| 64 | - if( !$this->args['image'] )return; |
|
| 66 | + if( !$this->args['image'] ) { |
|
| 67 | + return; |
|
| 68 | + } |
|
| 65 | 69 | return sprintf( '<div class="video-screenshot" style="background-image: url(%s)">%s</div>', |
| 66 | 70 | $this->args['image'], |
| 67 | 71 | $this->renderPlayButton() |
@@ -99,7 +103,9 @@ discard block |
||
| 99 | 103 | |
| 100 | 104 | foreach( $this->args as $key => $value ) { |
| 101 | 105 | $method = $this->utility->buildMethodName( $key, 'set' ); |
| 102 | - if( !method_exists( $this, $method ))continue; |
|
| 106 | + if( !method_exists( $this, $method )) { |
|
| 107 | + continue; |
|
| 108 | + } |
|
| 103 | 109 | call_user_func([ $this, $method ], $value ); |
| 104 | 110 | } |
| 105 | 111 | return $this->args; |
@@ -25,7 +25,9 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function get( $attachment ) |
| 27 | 27 | { |
| 28 | - if( !( $attachment = $this->normalize( $attachment )))return; |
|
| 28 | + if( !( $attachment = $this->normalize( $attachment ))) { |
|
| 29 | + return; |
|
| 30 | + } |
|
| 29 | 31 | if( $thumbnail = wp_get_attachment_image_src( $attachment, 'thumbnail' )) { |
| 30 | 32 | $medium = $this->normalizeSrc( wp_get_attachment_image_src( $attachment, 'medium' ), $thumbnail ); |
| 31 | 33 | $large = $this->normalizeSrc( wp_get_attachment_image_src( $attachment, 'large' ), $medium ); |
@@ -57,7 +59,9 @@ discard block |
||
| 57 | 59 | |
| 58 | 60 | $attachment = get_post( $attachmentId ); |
| 59 | 61 | |
| 60 | - if( !$attachmentId || !$attachment || $attachment->post_type != 'attachment' )return; |
|
| 62 | + if( !$attachmentId || !$attachment || $attachment->post_type != 'attachment' ) { |
|
| 63 | + return; |
|
| 64 | + } |
|
| 61 | 65 | |
| 62 | 66 | return $attachment->ID; |
| 63 | 67 | } |
@@ -65,7 +65,9 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $image = $this->image->get( $attachment->ID )->image; |
| 67 | 67 | |
| 68 | - if( !$image )return; |
|
| 68 | + if( !$image ) { |
|
| 69 | + return; |
|
| 70 | + } |
|
| 69 | 71 | return sprintf( |
| 70 | 72 | '<figure class="gallery-image" data-w="%s" data-h="%s" data-ps=\'%s\' itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">' . |
| 71 | 73 | '%s<figcaption itemprop="caption description">' . |
@@ -86,7 +88,9 @@ discard block |
||
| 86 | 88 | */ |
| 87 | 89 | public function renderPagination() |
| 88 | 90 | { |
| 89 | - if( !$this->args['pagination'] )return; |
|
| 91 | + if( !$this->args['pagination'] ) { |
|
| 92 | + return; |
|
| 93 | + } |
|
| 90 | 94 | return paginate_links([ |
| 91 | 95 | 'before_page_number' => '<span class="screen-reader-text">' . __( 'Page', 'castor' ) . ' </span>', |
| 92 | 96 | 'current' => $this->gallery->query['paged'], |