@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | $expected_settings = array( array( 'current:user' ) ); |
41 | 41 | |
42 | - if ( ! isset( $settings['args'] ) || $settings['args'] !== $expected_settings ) { |
|
42 | + if ( ! isset( $settings[ 'args' ] ) || $settings[ 'args' ] !== $expected_settings ) { |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function get_points_logs_to_be_reversed( WordPoints_Hook_Fire $fire ) { |
67 | 67 | |
68 | - if ( isset( $fire->data[ $this->slug ]['points_logs'] ) ) { |
|
69 | - return $fire->data[ $this->slug ]['points_logs']; |
|
68 | + if ( isset( $fire->data[ $this->slug ][ 'points_logs' ] ) ) { |
|
69 | + return $fire->data[ $this->slug ][ 'points_logs' ]; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $meta_queries = array( |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | $entities = $fire->event_args->get_signature_args(); |
86 | 86 | |
87 | 87 | if ( ! $entities ) { |
88 | - $fire->data[ $this->slug ]['points_logs'] = array(); |
|
88 | + $fire->data[ $this->slug ][ 'points_logs' ] = array(); |
|
89 | 89 | return array(); |
90 | 90 | } |
91 | 91 | |
92 | 92 | // Legacy hooks only ever related to a single entity. |
93 | 93 | $entity = reset( $entities ); |
94 | 94 | |
95 | - $meta_queries[] = array( |
|
95 | + $meta_queries[ ] = array( |
|
96 | 96 | 'key' => $meta_key, |
97 | 97 | 'value' => $entity->get_the_id(), |
98 | 98 | ); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $logs = array(); |
118 | 118 | } |
119 | 119 | |
120 | - $fire->data[ $this->slug ]['points_logs'] = $logs; |
|
120 | + $fire->data[ $this->slug ][ 'points_logs' ] = $logs; |
|
121 | 121 | |
122 | 122 | return $logs; |
123 | 123 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
49 | 49 | |
50 | - switch ( $parsed['dynamic'] ) { |
|
50 | + switch ( $parsed[ 'dynamic' ] ) { |
|
51 | 51 | |
52 | 52 | case 'post': |
53 | 53 | return __( 'Post deleted.', 'wordpoints' ); |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | */ |
51 | 51 | protected function verify_settings( $instance ) { |
52 | 52 | |
53 | - if ( empty( $instance['num_users'] ) ) { |
|
54 | - $instance['num_users'] = $this->defaults['num_users']; |
|
53 | + if ( empty( $instance[ 'num_users' ] ) ) { |
|
54 | + $instance[ 'num_users' ] = $this->defaults[ 'num_users' ]; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | return parent::verify_settings( $instance ); |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | protected function widget_body( $instance ) { |
65 | 65 | |
66 | 66 | wordpoints_points_show_top_users( |
67 | - $instance['num_users'] |
|
68 | - , $instance['points_type'] |
|
67 | + $instance[ 'num_users' ] |
|
68 | + , $instance[ 'points_type' ] |
|
69 | 69 | , 'widget' |
70 | 70 | ); |
71 | 71 | } |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | |
86 | 86 | parent::update( $new_instance, $old_instance ); |
87 | 87 | |
88 | - if ( ! wordpoints_posint( $this->instance['num_users'] ) ) { |
|
89 | - $this->instance['num_users'] = $this->defaults['num_users']; |
|
88 | + if ( ! wordpoints_posint( $this->instance[ 'num_users' ] ) ) { |
|
89 | + $this->instance[ 'num_users' ] = $this->defaults[ 'num_users' ]; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | return $this->instance; |
@@ -100,15 +100,15 @@ discard block |
||
100 | 100 | |
101 | 101 | parent::form( $instance ); |
102 | 102 | |
103 | - if ( ! wordpoints_posint( $this->instance['num_users'] ) ) { |
|
104 | - $this->instance['num_users'] = $this->defaults['num_users']; |
|
103 | + if ( ! wordpoints_posint( $this->instance[ 'num_users' ] ) ) { |
|
104 | + $this->instance[ 'num_users' ] = $this->defaults[ 'num_users' ]; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | ?> |
108 | 108 | |
109 | 109 | <p> |
110 | 110 | <label for="<?php echo esc_attr( $this->get_field_id( 'num_users' ) ); ?>"><?php esc_html_e( 'Number of top users to show', 'wordpoints' ); ?></label> |
111 | - <input type="number" min="1" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'num_users' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'num_users' ) ); ?>" value="<?php echo absint( $this->instance['num_users'] ); ?>" /> |
|
111 | + <input type="number" min="1" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'num_users' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'num_users' ) ); ?>" value="<?php echo absint( $this->instance[ 'num_users' ] ); ?>" /> |
|
112 | 112 | </p> |
113 | 113 | |
114 | 114 | <?php |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | protected function verify_atts() { |
21 | 21 | |
22 | - if ( isset( $this->pairs['rank_group'] ) && empty( $this->atts['rank_group'] ) ) { |
|
22 | + if ( isset( $this->pairs[ 'rank_group' ] ) && empty( $this->atts[ 'rank_group' ] ) ) { |
|
23 | 23 | |
24 | 24 | return sprintf( |
25 | 25 | // translators: 1. Attribute name; 2. Shortcode name. |
@@ -37,8 +37,8 @@ |
||
37 | 37 | protected function generate() { |
38 | 38 | |
39 | 39 | return wordpoints_get_formatted_user_rank( |
40 | - $this->atts['user_id'] |
|
41 | - , $this->atts['rank_group'] |
|
40 | + $this->atts[ 'user_id' ] |
|
41 | + , $this->atts[ 'rank_group' ] |
|
42 | 42 | , 'user_rank_shortcode' |
43 | 43 | ); |
44 | 44 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | 'type' => 'db', |
34 | 34 | 'info' => array( |
35 | 35 | 'type' => 'table', |
36 | - 'table_name' => $GLOBALS['wpdb']->{$this->wpdb_table_name}, |
|
36 | + 'table_name' => $GLOBALS[ 'wpdb' ]->{$this->wpdb_table_name}, |
|
37 | 37 | ), |
38 | 38 | ); |
39 | 39 | } |
@@ -92,7 +92,7 @@ |
||
92 | 92 | } |
93 | 93 | } |
94 | 94 | |
95 | - $this->switched[] = $switched; |
|
95 | + $this->switched[ ] = $switched; |
|
96 | 96 | |
97 | 97 | return true; |
98 | 98 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $depth = count( $hierarchy ); |
52 | 52 | |
53 | 53 | if ( 1 === $depth ) { |
54 | - $class_hierarchies[] = array(); |
|
54 | + $class_hierarchies[ ] = array(); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | if ( is_array( $entity_id ) ) { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | // If a user isn't allowed to even know about an entity, they can't do |
73 | 73 | // anything else either. So we always check that too. |
74 | 74 | if ( 'know' !== $type ) { |
75 | - $types[] = 'know'; |
|
75 | + $types[ ] = 'know'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | foreach ( $types as $type ) { |