@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | 'type' => 'db', |
54 | 54 | 'info' => array( |
55 | 55 | 'type' => 'table', |
56 | - 'table_name' => $GLOBALS['wpdb']->usermeta, |
|
56 | + 'table_name' => $GLOBALS[ 'wpdb' ]->usermeta, |
|
57 | 57 | 'primary_id_field' => 'user_id', |
58 | 58 | 'related_id_field' => array( |
59 | 59 | 'type' => 'serialized_array', |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'conditions' => array( |
63 | 63 | array( |
64 | 64 | 'field' => 'meta_key', |
65 | - 'value' => $GLOBALS['wpdb']->get_blog_prefix() . 'capabilities', |
|
65 | + 'value' => $GLOBALS[ 'wpdb' ]->get_blog_prefix() . 'capabilities', |
|
66 | 66 | ), |
67 | 67 | ), |
68 | 68 | ), |
@@ -129,7 +129,7 @@ |
||
129 | 129 | 'type' => 'db', |
130 | 130 | 'info' => array( |
131 | 131 | 'type' => 'meta_table', |
132 | - 'table_name' => $GLOBALS['wpdb']->{$this->wpdb_table_name}, |
|
132 | + 'table_name' => $GLOBALS[ 'wpdb' ]->{$this->wpdb_table_name}, |
|
133 | 133 | 'meta_key' => $this->meta_key, |
134 | 134 | 'meta_key_field' => $this->meta_key_field, |
135 | 135 | 'meta_value_field' => $this->meta_value_field, |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | foreach ( $restrictions as $restriction ) { |
66 | 66 | if ( $restriction->applies() ) { |
67 | - $this->restrictions[] = $restriction; |
|
67 | + $this->restrictions[ ] = $restriction; |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | |
52 | 52 | $this->entity_id = $entity_id; |
53 | 53 | |
54 | - $entity = wordpoints_entities()->get( $hierarchy[0] ); |
|
54 | + $entity = wordpoints_entities()->get( $hierarchy[ 0 ] ); |
|
55 | 55 | |
56 | 56 | if ( ! $entity instanceof WordPoints_Entity ) { |
57 | 57 | return; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * @since 2.2.0 |
32 | 32 | */ |
33 | 33 | public function __construct( $entity_id, array $hierarchy ) { |
34 | - $this->is_registered = wordpoints_entities()->is_registered( $hierarchy[0] ); |
|
34 | + $this->is_registered = wordpoints_entities()->is_registered( $hierarchy[ 0 ] ); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -114,7 +114,7 @@ |
||
114 | 114 | array $args = array() |
115 | 115 | ) { |
116 | 116 | |
117 | - $pass_slugs = ( ! isset( $args['pass_slugs'] ) || $args['pass_slugs'] ); |
|
117 | + $pass_slugs = ( ! isset( $args[ 'pass_slugs' ] ) || $args[ 'pass_slugs' ] ); |
|
118 | 118 | |
119 | 119 | $objects = array(); |
120 | 120 |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | |
55 | 55 | $items = array(); |
56 | 56 | |
57 | - if ( $this->settings['pass_slugs'] ) { |
|
57 | + if ( $this->settings[ 'pass_slugs' ] ) { |
|
58 | 58 | array_unshift( $args, null ); |
59 | 59 | } |
60 | 60 | |
61 | 61 | foreach ( $this->classes as $parent_slug => $classes ) { |
62 | 62 | $items[ $parent_slug ] = WordPoints_Class_Registry::construct_with_args( |
63 | 63 | $classes |
64 | - , $this->settings['pass_slugs'] ? array( $parent_slug ) + $args : $args |
|
64 | + , $this->settings[ 'pass_slugs' ] ? array( $parent_slug ) + $args : $args |
|
65 | 65 | , $this->settings |
66 | 66 | ); |
67 | 67 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | if ( isset( $this->classes[ $parent_slug ] ) ) { |
87 | 87 | |
88 | - if ( $this->settings['pass_slugs'] ) { |
|
88 | + if ( $this->settings[ 'pass_slugs' ] ) { |
|
89 | 89 | array_unshift( $args, $parent_slug ); |
90 | 90 | } |
91 | 91 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | if ( empty( $args ) ) { |
128 | 128 | |
129 | - if ( $this->settings['pass_slugs'] ) { |
|
129 | + if ( $this->settings[ 'pass_slugs' ] ) { |
|
130 | 130 | return new $class( $slug, $parent_slug ); |
131 | 131 | } else { |
132 | 132 | return new $class(); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | } else { |
136 | 136 | |
137 | - if ( $this->settings['pass_slugs'] ) { |
|
137 | + if ( $this->settings[ 'pass_slugs' ] ) { |
|
138 | 138 | array_unshift( $args, $slug, $parent_slug ); |
139 | 139 | } |
140 | 140 |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | |
66 | 66 | $classes = $this->get_deep( $this->classes, $parent_slugs ); |
67 | 67 | |
68 | - if ( ! $classes || ! isset( $classes['_classes'] ) ) { |
|
68 | + if ( ! $classes || ! isset( $classes[ '_classes' ] ) ) { |
|
69 | 69 | return array(); |
70 | 70 | } |
71 | 71 | |
72 | - if ( $this->settings['pass_slugs'] ) { |
|
72 | + if ( $this->settings[ 'pass_slugs' ] ) { |
|
73 | 73 | array_unshift( $args, $parent_slugs ); |
74 | 74 | } |
75 | 75 | |
76 | 76 | return WordPoints_Class_Registry::construct_with_args( |
77 | - $classes['_classes'] |
|
77 | + $classes[ '_classes' ] |
|
78 | 78 | , $args |
79 | 79 | , $this->settings |
80 | 80 | ); |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | |
90 | 90 | $classes = $this->get_deep( $this->classes, $parent_slugs ); |
91 | 91 | |
92 | - if ( $classes && isset( $classes['_classes'] ) ) { |
|
93 | - $slugs = array_keys( $classes['_classes'] ); |
|
92 | + if ( $classes && isset( $classes[ '_classes' ] ) ) { |
|
93 | + $slugs = array_keys( $classes[ '_classes' ] ); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | return $slugs; |
@@ -112,15 +112,15 @@ discard block |
||
112 | 112 | |
113 | 113 | $classes = $this->get_deep( $this->classes, $parent_slugs ); |
114 | 114 | |
115 | - if ( ! $classes || ! isset( $classes['_classes'][ $slug ] ) ) { |
|
115 | + if ( ! $classes || ! isset( $classes[ '_classes' ][ $slug ] ) ) { |
|
116 | 116 | return false; |
117 | 117 | } |
118 | 118 | |
119 | - $class = $classes['_classes'][ $slug ]; |
|
119 | + $class = $classes[ '_classes' ][ $slug ]; |
|
120 | 120 | |
121 | 121 | if ( empty( $args ) ) { |
122 | 122 | |
123 | - if ( $this->settings['pass_slugs'] ) { |
|
123 | + if ( $this->settings[ 'pass_slugs' ] ) { |
|
124 | 124 | return new $class( $slug, $parent_slugs ); |
125 | 125 | } else { |
126 | 126 | return new $class(); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | } else { |
130 | 130 | |
131 | - if ( $this->settings['pass_slugs'] ) { |
|
131 | + if ( $this->settings[ 'pass_slugs' ] ) { |
|
132 | 132 | array_unshift( $args, $slug, $parent_slugs ); |
133 | 133 | } |
134 | 134 | |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | $classes[ $parent_slug ] = array(); |
155 | 155 | } |
156 | 156 | |
157 | - $classes =& $classes[ $parent_slug ]; |
|
157 | + $classes = & $classes[ $parent_slug ]; |
|
158 | 158 | } |
159 | 159 | |
160 | - $classes['_classes'][ $slug ] = $class; |
|
160 | + $classes[ '_classes' ][ $slug ] = $class; |
|
161 | 161 | |
162 | 162 | return true; |
163 | 163 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | return; |
174 | 174 | } |
175 | 175 | |
176 | - unset( $classes['_classes'][ $slug ] ); |
|
176 | + unset( $classes[ '_classes' ][ $slug ] ); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | return; |
188 | 188 | } |
189 | 189 | |
190 | - unset( $classes['_classes'] ); |
|
190 | + unset( $classes[ '_classes' ] ); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -195,10 +195,10 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function is_registered( $slug, array $parent_slugs = array() ) { |
197 | 197 | |
198 | - $parent_slugs[] = '_classes'; |
|
198 | + $parent_slugs[ ] = '_classes'; |
|
199 | 199 | |
200 | 200 | if ( null !== $slug ) { |
201 | - $parent_slugs[] = $slug; |
|
201 | + $parent_slugs[ ] = $slug; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | return (bool) $this->get_deep( $this->classes, $parent_slugs ); |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | |
101 | 101 | $index = $this->get_reaction_index(); |
102 | 102 | |
103 | - if ( ! isset( $index[ $id ]['event'] ) ) { |
|
103 | + if ( ! isset( $index[ $id ][ 'event' ] ) ) { |
|
104 | 104 | return false; |
105 | 105 | } |
106 | 106 | |
107 | - return $index[ $id ]['event']; |
|
107 | + return $index[ $id ][ 'event' ]; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | return false; |
128 | 128 | } |
129 | 129 | |
130 | - $index[ $id ]['event'] = $event; |
|
130 | + $index[ $id ][ 'event' ] = $event; |
|
131 | 131 | |
132 | 132 | return $this->update_reaction_index( $index ); |
133 | 133 | } |
@@ -147,13 +147,13 @@ discard block |
||
147 | 147 | |
148 | 148 | foreach ( $index as $reaction ) { |
149 | 149 | |
150 | - $object = $this->get_reaction( $reaction['id'] ); |
|
150 | + $object = $this->get_reaction( $reaction[ 'id' ] ); |
|
151 | 151 | |
152 | 152 | if ( ! $object ) { |
153 | 153 | continue; |
154 | 154 | } |
155 | 155 | |
156 | - $reactions[] = $object; |
|
156 | + $reactions[ ] = $object; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | return $reactions; |