@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | if( $args['total'] < 2 )return; |
17 | 17 | $paged = glsr( QueryBuilder::class )->getPaged(); |
18 | 18 | $links = $this->buildLinksForDeprecatedThemes( $args['total'], $paged ); |
19 | - if( empty( $links )) { |
|
19 | + if( empty($links) ) { |
|
20 | 20 | $links = $this->buildLinks( $args['total'], $paged ); |
21 | 21 | } |
22 | 22 | $links = apply_filters( 'site-reviews/reviews/navigation_links', $links, $paged, $args['total'] ); |
23 | - if( empty( $links ))return; |
|
23 | + if( empty($links) )return; |
|
24 | 24 | return $this->buildTemplate( $links ); |
25 | 25 | } |
26 | 26 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | 'total' => $totalPages, |
42 | 42 | ]; |
43 | 43 | if( is_front_page() ) { |
44 | - unset( $paginateArgs['format'] ); |
|
44 | + unset($paginateArgs['format']); |
|
45 | 45 | } |
46 | 46 | return paginate_links( $paginateArgs ); |
47 | 47 | } |
@@ -54,16 +54,16 @@ discard block |
||
54 | 54 | protected function buildLinksForDeprecatedThemes( $totalPages, $paged ) |
55 | 55 | { |
56 | 56 | $theme = wp_get_theme()->get( 'TextDomain' ); |
57 | - if( !in_array( $theme, ['twentyten','twentyeleven','twentytwelve','twentythirteen'] ))return; |
|
57 | + if( !in_array( $theme, ['twentyten', 'twentyeleven', 'twentytwelve', 'twentythirteen'] ) )return; |
|
58 | 58 | $links = ''; |
59 | 59 | if( $paged > 1 ) { |
60 | - $links.= sprintf( '<div class="nav-previous"><a href="%s"><span class="meta-nav">←</span> %s</a></div>', |
|
60 | + $links .= sprintf( '<div class="nav-previous"><a href="%s"><span class="meta-nav">←</span> %s</a></div>', |
|
61 | 61 | $this->buildUrlForDeprecatedThemes( $paged, -1 ), |
62 | 62 | __( 'Previous', 'site-reviews' ) |
63 | 63 | ); |
64 | 64 | } |
65 | 65 | if( $paged < $totalPages ) { |
66 | - $links.= sprintf( '<div class="nav-next"><a href="%s">%s <span class="meta-nav">→</span></a></div>', |
|
66 | + $links .= sprintf( '<div class="nav-next"><a href="%s">%s <span class="meta-nav">→</span></a></div>', |
|
67 | 67 | $this->buildUrlForDeprecatedThemes( $paged, 1 ), |
68 | 68 | __( 'Next', 'site-reviews' ) |
69 | 69 | ); |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | $template = '<nav class="%1$s" role="navigation">%3$s</nav>'; |
87 | 87 | break; |
88 | 88 | case 'twentyfourteen': |
89 | - $class.= ' paging-navigation'; |
|
89 | + $class .= ' paging-navigation'; |
|
90 | 90 | $template = '<nav class="%1$s" role="navigation"><h2 class="screen-reader-text">%2$s</h2><div class="pagination loop-pagination">%3$s</div></nav>'; |
91 | 91 | break; |
92 | 92 | default: |
93 | - $class.= ' pagination'; |
|
93 | + $class .= ' pagination'; |
|
94 | 94 | $template = '<nav class="%1$s" role="navigation"><h2 class="screen-reader-text">%2$s</h2><div class="nav-links">%3$s</div></nav>'; |
95 | 95 | } |
96 | 96 | $template = apply_filters( 'navigation_markup_template', $template, $class ); |
@@ -13,14 +13,18 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function build( array $args = [] ) |
15 | 15 | { |
16 | - if( $args['total'] < 2 )return; |
|
16 | + if( $args['total'] < 2 ) { |
|
17 | + return; |
|
18 | + } |
|
17 | 19 | $paged = glsr( QueryBuilder::class )->getPaged(); |
18 | 20 | $links = $this->buildLinksForDeprecatedThemes( $args['total'], $paged ); |
19 | 21 | if( empty( $links )) { |
20 | 22 | $links = $this->buildLinks( $args['total'], $paged ); |
21 | 23 | } |
22 | 24 | $links = apply_filters( 'site-reviews/reviews/navigation_links', $links, $paged, $args['total'] ); |
23 | - if( empty( $links ))return; |
|
25 | + if( empty( $links )) { |
|
26 | + return; |
|
27 | + } |
|
24 | 28 | return $this->buildTemplate( $links ); |
25 | 29 | } |
26 | 30 | |
@@ -54,7 +58,9 @@ discard block |
||
54 | 58 | protected function buildLinksForDeprecatedThemes( $totalPages, $paged ) |
55 | 59 | { |
56 | 60 | $theme = wp_get_theme()->get( 'TextDomain' ); |
57 | - if( !in_array( $theme, ['twentyten','twentyeleven','twentytwelve','twentythirteen'] ))return; |
|
61 | + if( !in_array( $theme, ['twentyten','twentyeleven','twentytwelve','twentythirteen'] )) { |
|
62 | + return; |
|
63 | + } |
|
58 | 64 | $links = ''; |
59 | 65 | if( $paged > 1 ) { |
60 | 66 | $links.= sprintf( '<div class="nav-previous"><a href="%s"><span class="meta-nav">←</span> %s</a></div>', |