@@ -31,7 +31,7 @@ |
||
31 | 31 | $diff = time() - strtotime( $date ); |
32 | 32 | foreach( static::$TIME_PERIODS as $i => $timePeriod ) { |
33 | 33 | if( $diff > $timePeriod[0] )continue; |
34 | - $unit = intval( floor( $diff / $timePeriod[1] )); |
|
34 | + $unit = intval( floor( $diff / $timePeriod[1] ) ); |
|
35 | 35 | $relativeDates = [ |
36 | 36 | _n( '%s second ago', '%s seconds ago', $unit, 'site-reviews' ), |
37 | 37 | _n( '%s minute ago', '%s minutes ago', $unit, 'site-reviews' ), |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php defined( 'WPINC' ) || die; |
2 | 2 | |
3 | -include trailingslashit(__DIR__).'header.php'; |
|
4 | -include trailingslashit(__DIR__).'body.php'; |
|
5 | -include trailingslashit(__DIR__).'footer.php'; |
|
3 | +include trailingslashit( __DIR__ ).'header.php'; |
|
4 | +include trailingslashit( __DIR__ ).'body.php'; |
|
5 | +include trailingslashit( __DIR__ ).'footer.php'; |
@@ -51,9 +51,9 @@ |
||
51 | 51 | protected function normalize( array $data ) |
52 | 52 | { |
53 | 53 | $arrayKeys = ['context', 'globals']; |
54 | - $data = wp_parse_args( $data, array_fill_keys( $arrayKeys, [] )); |
|
54 | + $data = wp_parse_args( $data, array_fill_keys( $arrayKeys, [] ) ); |
|
55 | 55 | foreach( $arrayKeys as $key ) { |
56 | - if( is_array( $data[$key] ))continue; |
|
56 | + if( is_array( $data[$key] ) )continue; |
|
57 | 57 | $data[$key] = []; |
58 | 58 | } |
59 | 59 | return $data; |
@@ -13,7 +13,7 @@ |
||
13 | 13 | { |
14 | 14 | $this->builder->args = wp_parse_args( $this->builder->args, [ |
15 | 15 | 'name' => $this->builder->args['text'], |
16 | - ]); |
|
16 | + ] ); |
|
17 | 17 | $this->builder->tag = 'input'; |
18 | 18 | $this->mergeFieldArgs(); |
19 | 19 | return $this->builder->getOpeningTag(); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | glsr()->version, |
45 | 45 | true |
46 | 46 | ); |
47 | - if( !empty( $this->pointers )) { |
|
47 | + if( !empty($this->pointers) ) { |
|
48 | 48 | wp_enqueue_style( 'wp-pointer' ); |
49 | 49 | wp_enqueue_script( 'wp-pointer' ); |
50 | 50 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $dependencies = apply_filters( 'site-reviews/enqueue/admin/dependencies', [] ); |
85 | 85 | $dependencies = array_merge( $dependencies, [ |
86 | 86 | 'jquery', 'jquery-ui-sortable', 'underscore', 'wp-util', |
87 | - ]); |
|
87 | + ] ); |
|
88 | 88 | return $dependencies; |
89 | 89 | } |
90 | 90 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $generatedPointers = []; |
115 | 115 | foreach( $pointers as $pointer ) { |
116 | 116 | if( $pointer['screen'] != glsr_current_screen()->id )continue; |
117 | - if( in_array( $pointer['id'], $dismissedPointers ))continue; |
|
117 | + if( in_array( $pointer['id'], $dismissedPointers ) )continue; |
|
118 | 118 | $generatedPointers[] = $this->generatePointer( $pointer ); |
119 | 119 | } |
120 | 120 | $this->pointers = $generatedPointers; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | protected function isCurrentScreen() |
127 | 127 | { |
128 | 128 | $screen = glsr_current_screen(); |
129 | - return $screen && ( $screen->post_type == Application::POST_TYPE |
|
129 | + return $screen && ($screen->post_type == Application::POST_TYPE |
|
130 | 130 | || $screen->base == 'post' |
131 | 131 | || $screen->id == 'dashboard' |
132 | 132 | || $screen->id == 'widgets' |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | $variables = []; |
142 | 142 | foreach( glsr()->mceShortcodes as $tag => $args ) { |
143 | - if( empty( $args['required'] ))continue; |
|
143 | + if( empty($args['required']) )continue; |
|
144 | 144 | $variables[$tag] = $args['required']; |
145 | 145 | } |
146 | 146 | return $variables; |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | defined( 'WPINC' ) || die; |
4 | 4 | |
5 | -require_once( ABSPATH.WPINC.'/class-phpass.php' ); |
|
5 | +require_once(ABSPATH.WPINC.'/class-phpass.php'); |
|
6 | 6 | |
7 | 7 | spl_autoload_register( function( $className ) { |
8 | 8 | $namespaces = [ |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | foreach( $namespaces as $prefix => $baseDir ) { |
17 | 17 | $len = strlen( $prefix ); |
18 | 18 | if( strncmp( $prefix, $className, $len ) !== 0 )continue; |
19 | - $file = $baseDir.str_replace( '\\', '/', substr( $className, $len )).'.php'; |
|
20 | - if( !file_exists( $file ))continue; |
|
19 | + $file = $baseDir.str_replace( '\\', '/', substr( $className, $len ) ).'.php'; |
|
20 | + if( !file_exists( $file ) )continue; |
|
21 | 21 | require $file; |
22 | 22 | break; |
23 | 23 | } |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | <div id="<?= $tax_name; ?>-all" class="tabs-panel"> |
17 | 17 | <input type="hidden" name="tax_input[<?= $tax_name; ?>][]" value='0' /> |
18 | 18 | <ul id="<?= $tax_name; ?>checklist" data-wp-lists="list:<?= $tax_name; ?>" class="categorychecklist form-no-clear"> |
19 | - <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids )); ?> |
|
19 | + <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids ) ); ?> |
|
20 | 20 | </ul> |
21 | 21 | </div> |
22 | 22 | |
23 | - <?php if( current_user_can( $taxonomy->cap->edit_terms )) : ?> |
|
23 | + <?php if( current_user_can( $taxonomy->cap->edit_terms ) ) : ?> |
|
24 | 24 | <div id="<?= $tax_name; ?>-adder" class="wp-hidden-children"> |
25 | 25 | <a id="<?= $tax_name; ?>-add-toggle" href="#<?= $tax_name; ?>-add" class="hide-if-no-js taxonomy-add-new"> |
26 | 26 | <?= sprintf( '+ %s', $taxonomy->labels->add_new_item ); ?> |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | <label class="screen-reader-text" for="new<?= $tax_name; ?>"><?= $taxonomy->labels->add_new_item; ?></label> |
30 | 30 | <input type="text" name="new<?= $tax_name; ?>" id="new<?= $tax_name; ?>" class="form-required form-input-tip" value="<?= esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/> |
31 | 31 | <input type="button" id="<?= $tax_name; ?>-add-submit" data-wp-lists="add:<?= $tax_name; ?>checklist:<?= $tax_name; ?>-add" class="button category-add-submit" value="<?= esc_attr( $taxonomy->labels->add_new_item ); ?>" /> |
32 | - <?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?> |
|
32 | + <?php wp_nonce_field( 'add-'.$tax_name, '_ajax_nonce-add-'.$tax_name, false ); ?> |
|
33 | 33 | <span id="<?= $tax_name; ?>-ajax-response"></span> |
34 | 34 | </div> |
35 | 35 | </div> |
@@ -57,7 +57,7 @@ |
||
57 | 57 | */ |
58 | 58 | protected function isReviewEditable() |
59 | 59 | { |
60 | - $postId = intval( filter_input( INPUT_GET, 'post' )); |
|
60 | + $postId = intval( filter_input( INPUT_GET, 'post' ) ); |
|
61 | 61 | return $postId > 0 |
62 | 62 | && get_post_meta( $postId, 'review_type', true ) == 'local' |
63 | 63 | && $this->isReviewEditor(); |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | { |
31 | 31 | foreach( $args as $key => $value ) { |
32 | 32 | $property = glsr( Helper::class )->buildPropertyName( $key ); |
33 | - if( !property_exists( $this, $property ))continue; |
|
33 | + if( !property_exists( $this, $property ) )continue; |
|
34 | 34 | $this->$property = $value; |
35 | - unset( $args[$key] ); |
|
35 | + unset($args[$key]); |
|
36 | 36 | } |
37 | 37 | $this->args = wp_parse_args( $args, [ |
38 | 38 | 'menu_name' => $this->plural, |
39 | - ]); |
|
39 | + ] ); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | 'singular_name' => $this->single, |
60 | 60 | 'uploaded_to_this_item' => sprintf( _x( 'Uploaded to this %s', 'Uploaded to this Post', 'site-reviews' ), $this->single ), |
61 | 61 | 'view_item' => sprintf( _x( 'View %s', 'View Post', 'site-reviews' ), $this->single ), |
62 | - ]); |
|
63 | - unset( $this->args['menu_name'] ); |
|
62 | + ] ); |
|
63 | + unset($this->args['menu_name']); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | protected function normalizeColumns() |
70 | 70 | { |
71 | 71 | $this->columns = ['cb' => ''] + $this->columns; |
72 | - if( array_key_exists( 'category', $this->columns )) { |
|
72 | + if( array_key_exists( 'category', $this->columns ) ) { |
|
73 | 73 | $keys = array_keys( $this->columns ); |
74 | 74 | $keys[array_search( 'category', $keys )] = 'taxonomy-'.Application::TAXONOMY; |
75 | 75 | $this->columns = array_combine( $keys, $this->columns ); |
76 | 76 | } |
77 | - if( array_key_exists( 'pinned', $this->columns )) { |
|
77 | + if( array_key_exists( 'pinned', $this->columns ) ) { |
|
78 | 78 | $this->columns['pinned'] = glsr( Builder::class )->span( '<span>'.$this->columns['pinned'].'</span>', |
79 | 79 | ['class' => 'pinned-icon'] |
80 | 80 | ); |