@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | |
43 | 43 | $conditions_data = array(); |
44 | 44 | |
45 | - foreach ( $this->conditions->get_all() as $data_type => $conditions ) { |
|
46 | - foreach ( $conditions as $slug => $condition ) { |
|
45 | + foreach ($this->conditions->get_all() as $data_type => $conditions) { |
|
46 | + foreach ($conditions as $slug => $condition) { |
|
47 | 47 | |
48 | - if ( ! ( $condition instanceof WordPoints_Hook_Condition ) ) { |
|
48 | + if ( ! ($condition instanceof WordPoints_Hook_Condition)) { |
|
49 | 49 | continue; |
50 | 50 | } |
51 | 51 | |
52 | - $conditions_data[ $data_type ][ $slug ] = array( |
|
52 | + $conditions_data[$data_type][$slug] = array( |
|
53 | 53 | 'slug' => $slug, |
54 | 54 | 'data_type' => $data_type, |
55 | 55 | 'title' => $condition->get_title(), |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | - return array( 'conditions' => $conditions_data ); |
|
61 | + return array('conditions' => $conditions_data); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -70,31 +70,31 @@ discard block |
||
70 | 70 | * |
71 | 71 | * @return array The validated settings. |
72 | 72 | */ |
73 | - protected function validate_conditions( $args ) { |
|
73 | + protected function validate_conditions($args) { |
|
74 | 74 | |
75 | - if ( ! is_array( $args ) ) { |
|
75 | + if ( ! is_array($args)) { |
|
76 | 76 | |
77 | 77 | $this->validator->add_error( |
78 | - __( 'Conditions do not match expected format.', 'wordpoints' ) |
|
78 | + __('Conditions do not match expected format.', 'wordpoints') |
|
79 | 79 | ); |
80 | 80 | |
81 | 81 | return array(); |
82 | 82 | } |
83 | 83 | |
84 | - foreach ( $args as $arg_slug => $sub_args ) { |
|
84 | + foreach ($args as $arg_slug => $sub_args) { |
|
85 | 85 | |
86 | - if ( '_conditions' === $arg_slug ) { |
|
86 | + if ('_conditions' === $arg_slug) { |
|
87 | 87 | |
88 | - $this->validator->push_field( $arg_slug ); |
|
88 | + $this->validator->push_field($arg_slug); |
|
89 | 89 | |
90 | - foreach ( $sub_args as $index => $settings ) { |
|
90 | + foreach ($sub_args as $index => $settings) { |
|
91 | 91 | |
92 | - $this->validator->push_field( $index ); |
|
92 | + $this->validator->push_field($index); |
|
93 | 93 | |
94 | - $condition = $this->validate_condition( $settings ); |
|
94 | + $condition = $this->validate_condition($settings); |
|
95 | 95 | |
96 | - if ( $condition ) { |
|
97 | - $sub_args[ $index ] = $condition; |
|
96 | + if ($condition) { |
|
97 | + $sub_args[$index] = $condition; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | $this->validator->pop_field(); |
@@ -104,18 +104,18 @@ discard block |
||
104 | 104 | |
105 | 105 | } else { |
106 | 106 | |
107 | - if ( ! $this->event_args->descend( $arg_slug ) ) { |
|
107 | + if ( ! $this->event_args->descend($arg_slug)) { |
|
108 | 108 | continue; |
109 | 109 | } |
110 | 110 | |
111 | - $sub_args = $this->validate_conditions( $sub_args ); |
|
111 | + $sub_args = $this->validate_conditions($sub_args); |
|
112 | 112 | |
113 | - $args[ $arg_slug ] = $sub_args; |
|
113 | + $args[$arg_slug] = $sub_args; |
|
114 | 114 | |
115 | 115 | $this->event_args->ascend(); |
116 | 116 | } |
117 | 117 | |
118 | - $args[ $arg_slug ] = $sub_args; |
|
118 | + $args[$arg_slug] = $sub_args; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | return $args; |
@@ -131,32 +131,32 @@ discard block |
||
131 | 131 | * @return array|false The validated conditions settings, or false if unable to |
132 | 132 | * validate. |
133 | 133 | */ |
134 | - protected function validate_condition( $settings ) { |
|
134 | + protected function validate_condition($settings) { |
|
135 | 135 | |
136 | - if ( ! isset( $settings['type'] ) ) { |
|
137 | - $this->validator->add_error( __( 'Condition type is missing.', 'wordpoints' ) ); |
|
136 | + if ( ! isset($settings['type'])) { |
|
137 | + $this->validator->add_error(__('Condition type is missing.', 'wordpoints')); |
|
138 | 138 | return false; |
139 | 139 | } |
140 | 140 | |
141 | 141 | $arg = $this->event_args->get_current(); |
142 | 142 | |
143 | - $data_type = $this->get_data_type( $arg ); |
|
143 | + $data_type = $this->get_data_type($arg); |
|
144 | 144 | |
145 | - if ( ! $data_type ) { |
|
145 | + if ( ! $data_type) { |
|
146 | 146 | $this->validator->add_error( |
147 | - __( 'This type of condition does not work for the selected attribute.', 'wordpoints' ) |
|
147 | + __('This type of condition does not work for the selected attribute.', 'wordpoints') |
|
148 | 148 | ); |
149 | 149 | |
150 | 150 | return false; |
151 | 151 | } |
152 | 152 | |
153 | - $condition = wordpoints_hooks()->conditions->get( $data_type, $settings['type'] ); |
|
153 | + $condition = wordpoints_hooks()->conditions->get($data_type, $settings['type']); |
|
154 | 154 | |
155 | - if ( ! $condition ) { |
|
155 | + if ( ! $condition) { |
|
156 | 156 | |
157 | 157 | $this->validator->add_error( |
158 | 158 | sprintf( |
159 | - __( 'Unknown condition type “%s”.', 'wordpoints' ) |
|
159 | + __('Unknown condition type “%s”.', 'wordpoints') |
|
160 | 160 | , $settings['type'] |
161 | 161 | ) |
162 | 162 | , 'type' |
@@ -165,17 +165,17 @@ discard block |
||
165 | 165 | return false; |
166 | 166 | } |
167 | 167 | |
168 | - if ( ! isset( $settings['settings'] ) ) { |
|
169 | - $this->validator->add_error( __( 'Condition settings are missing.', 'wordpoints' ) ); |
|
168 | + if ( ! isset($settings['settings'])) { |
|
169 | + $this->validator->add_error(__('Condition settings are missing.', 'wordpoints')); |
|
170 | 170 | return false; |
171 | 171 | } |
172 | 172 | |
173 | - $this->validator->push_field( 'settings' ); |
|
173 | + $this->validator->push_field('settings'); |
|
174 | 174 | |
175 | 175 | // The condition may call this object's validate_settings() method to |
176 | 176 | // validate some sub-conditions. When that happens, these properties will be |
177 | 177 | // reset, so we need to back up their values and then restore them below. |
178 | - $backup = array( $this->validator, $this->event_args ); |
|
178 | + $backup = array($this->validator, $this->event_args); |
|
179 | 179 | |
180 | 180 | $settings['settings'] = $condition->validate_settings( |
181 | 181 | $arg |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | , $this->validator |
184 | 184 | ); |
185 | 185 | |
186 | - list( $this->validator, $this->event_args ) = $backup; |
|
186 | + list($this->validator, $this->event_args) = $backup; |
|
187 | 187 | |
188 | 188 | $this->validator->pop_field(); |
189 | 189 | |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | WordPoints_Hook_Event_Args $event_args |
199 | 199 | ) { |
200 | 200 | |
201 | - $conditions = $reaction->get_meta( 'conditions' ); |
|
201 | + $conditions = $reaction->get_meta('conditions'); |
|
202 | 202 | |
203 | - if ( $conditions && ! $this->conditions_are_met( $conditions, $event_args ) ) { |
|
203 | + if ($conditions && ! $this->conditions_are_met($conditions, $event_args)) { |
|
204 | 204 | return false; |
205 | 205 | } |
206 | 206 | |
@@ -222,35 +222,35 @@ discard block |
||
222 | 222 | WordPoints_Hook_Event_Args $event_args |
223 | 223 | ) { |
224 | 224 | |
225 | - foreach ( $conditions as $arg_slug => $sub_args ) { |
|
225 | + foreach ($conditions as $arg_slug => $sub_args) { |
|
226 | 226 | |
227 | - $event_args->descend( $arg_slug ); |
|
227 | + $event_args->descend($arg_slug); |
|
228 | 228 | |
229 | - if ( isset( $sub_args['_conditions'] ) ) { |
|
229 | + if (isset($sub_args['_conditions'])) { |
|
230 | 230 | |
231 | - foreach ( $sub_args['_conditions'] as $settings ) { |
|
231 | + foreach ($sub_args['_conditions'] as $settings) { |
|
232 | 232 | |
233 | 233 | $condition = $this->conditions->get( |
234 | - $this->get_data_type( $event_args->get_current() ) |
|
234 | + $this->get_data_type($event_args->get_current()) |
|
235 | 235 | , $settings['type'] |
236 | 236 | ); |
237 | 237 | |
238 | - $is_met = $condition->is_met( $settings['settings'], $event_args ); |
|
238 | + $is_met = $condition->is_met($settings['settings'], $event_args); |
|
239 | 239 | |
240 | - if ( ! $is_met ) { |
|
240 | + if ( ! $is_met) { |
|
241 | 241 | $event_args->ascend(); |
242 | 242 | return false; |
243 | 243 | } |
244 | 244 | } |
245 | 245 | |
246 | - unset( $sub_args['_conditions'] ); |
|
246 | + unset($sub_args['_conditions']); |
|
247 | 247 | } |
248 | 248 | |
249 | - $are_met = $this->conditions_are_met( $sub_args, $event_args ); |
|
249 | + $are_met = $this->conditions_are_met($sub_args, $event_args); |
|
250 | 250 | |
251 | 251 | $event_args->ascend(); |
252 | 252 | |
253 | - if ( ! $are_met ) { |
|
253 | + if ( ! $are_met) { |
|
254 | 254 | return false; |
255 | 255 | } |
256 | 256 | } |
@@ -267,13 +267,13 @@ discard block |
||
267 | 267 | * |
268 | 268 | * @return string|false The data type, or false. |
269 | 269 | */ |
270 | - protected function get_data_type( $arg ) { |
|
270 | + protected function get_data_type($arg) { |
|
271 | 271 | |
272 | - if ( $arg instanceof WordPoints_Entity_Attr ) { |
|
272 | + if ($arg instanceof WordPoints_Entity_Attr) { |
|
273 | 273 | $data_type = $arg->get_data_type(); |
274 | - } elseif ( $arg instanceof WordPoints_Entity_Array ) { |
|
274 | + } elseif ($arg instanceof WordPoints_Entity_Array) { |
|
275 | 275 | $data_type = 'entity_array'; |
276 | - } elseif ( $arg instanceof WordPoints_Entity ) { |
|
276 | + } elseif ($arg instanceof WordPoints_Entity) { |
|
277 | 277 | $data_type = 'entity'; |
278 | 278 | } else { |
279 | 279 | $data_type = false; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function get_title() { |
21 | 21 | |
22 | - return __( 'Upload Media', 'wordpoints' ); |
|
22 | + return __('Upload Media', 'wordpoints'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function get_description() { |
29 | 29 | |
30 | - return __( 'When a file is uploaded to the Media Library.', 'wordpoints' ); |
|
30 | + return __('When a file is uploaded to the Media Library.', 'wordpoints'); |
|
31 | 31 | } |
32 | 32 | } |
33 | 33 |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function get_title() { |
38 | 38 | |
39 | - $post_type = get_post_type_object( substr( $this->slug, 5 /* post\ */ ) ); |
|
39 | + $post_type = get_post_type_object(substr($this->slug, 5 /* post\ */)); |
|
40 | 40 | |
41 | - if ( $post_type ) { |
|
41 | + if ($post_type) { |
|
42 | 42 | return $post_type->labels->singular_name; |
43 | 43 | } else { |
44 | 44 | return $this->slug; |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * @since 1.0.0 |
50 | 50 | */ |
51 | - public function user_can_view( $user_id, $id ) { |
|
52 | - return user_can( $user_id, 'read_post', $id ); |
|
51 | + public function user_can_view($user_id, $id) { |
|
52 | + return user_can($user_id, 'read_post', $id); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function get_title() { |
31 | 31 | |
32 | - $taxonomy = get_taxonomy( substr( $this->slug, 5 /* term\ */ ) ); |
|
32 | + $taxonomy = get_taxonomy(substr($this->slug, 5 /* term\ */)); |
|
33 | 33 | |
34 | - if ( $taxonomy ) { |
|
34 | + if ($taxonomy) { |
|
35 | 35 | return $taxonomy->labels->singular_name; |
36 | 36 | } else { |
37 | 37 | return $this->slug; |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * @since 1.0.0 |
43 | 43 | */ |
44 | - public function get_entity( $id ) { |
|
45 | - return get_term( $id, 'taxonomy' ); |
|
44 | + public function get_entity($id) { |
|
45 | + return get_term($id, 'taxonomy'); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function get_title() { |
31 | 31 | |
32 | - $taxonomy = get_taxonomy( substr( $this->slug, 6 /* terms\ */ ) ); |
|
32 | + $taxonomy = get_taxonomy(substr($this->slug, 6 /* terms\ */)); |
|
33 | 33 | |
34 | - if ( $taxonomy ) { |
|
34 | + if ($taxonomy) { |
|
35 | 35 | return $taxonomy->labels->name; |
36 | 36 | } else { |
37 | 37 | return parent::get_title(); |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * @since 1.0.0 |
43 | 43 | */ |
44 | - protected function get_related_entity_ids( WordPoints_Entity $entity ) { |
|
44 | + protected function get_related_entity_ids(WordPoints_Entity $entity) { |
|
45 | 45 | |
46 | 46 | $id = $entity->get_the_id(); |
47 | 47 | |
48 | - $taxonomies = get_object_taxonomies( get_post( $id ) ); |
|
48 | + $taxonomies = get_object_taxonomies(get_post($id)); |
|
49 | 49 | |
50 | - return wp_get_object_terms( $id, $taxonomies, array( 'fields' => 'ids' ) ); |
|
50 | + return wp_get_object_terms($id, $taxonomies, array('fields' => 'ids')); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 |
@@ -10,108 +10,108 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // auto-generated { |
13 | -require_once( dirname( __FILE__ ) . 'app.php' ); |
|
14 | -require_once( dirname( __FILE__ ) . 'app/registry.php' ); |
|
15 | -require_once( dirname( __FILE__ ) . 'class/autoloader.php' ); |
|
16 | -require_once( dirname( __FILE__ ) . 'class/registry.php' ); |
|
17 | -require_once( dirname( __FILE__ ) . 'class/registry/children.php' ); |
|
18 | -require_once( dirname( __FILE__ ) . 'class/registry/childreni.php' ); |
|
19 | -require_once( dirname( __FILE__ ) . 'class/registry/persistent.php' ); |
|
20 | -require_once( dirname( __FILE__ ) . 'class/registryi.php' ); |
|
21 | -require_once( dirname( __FILE__ ) . 'data/type.php' ); |
|
22 | -require_once( dirname( __FILE__ ) . 'data/type/integer.php' ); |
|
23 | -require_once( dirname( __FILE__ ) . 'data/type/text.php' ); |
|
24 | -require_once( dirname( __FILE__ ) . 'data/typei.php' ); |
|
25 | -require_once( dirname( __FILE__ ) . 'entity.php' ); |
|
26 | -require_once( dirname( __FILE__ ) . 'entity/array.php' ); |
|
27 | -require_once( dirname( __FILE__ ) . 'entity/attr.php' ); |
|
28 | -require_once( dirname( __FILE__ ) . 'entity/childi.php' ); |
|
29 | -require_once( dirname( __FILE__ ) . 'entity/comment.php' ); |
|
30 | -require_once( dirname( __FILE__ ) . 'entity/comment/author.php' ); |
|
31 | -require_once( dirname( __FILE__ ) . 'entity/comment/post.php' ); |
|
32 | -require_once( dirname( __FILE__ ) . 'entity/enumerablei.php' ); |
|
33 | -require_once( dirname( __FILE__ ) . 'entity/hierarchy.php' ); |
|
34 | -require_once( dirname( __FILE__ ) . 'entity/hierarchyi.php' ); |
|
35 | -require_once( dirname( __FILE__ ) . 'entity/parenti.php' ); |
|
36 | -require_once( dirname( __FILE__ ) . 'entity/post.php' ); |
|
37 | -require_once( dirname( __FILE__ ) . 'entity/post/author.php' ); |
|
38 | -require_once( dirname( __FILE__ ) . 'entity/post/content.php' ); |
|
39 | -require_once( dirname( __FILE__ ) . 'entity/post/terms.php' ); |
|
40 | -require_once( dirname( __FILE__ ) . 'entity/post/type.php' ); |
|
41 | -require_once( dirname( __FILE__ ) . 'entity/post/type/name.php' ); |
|
42 | -require_once( dirname( __FILE__ ) . 'entity/post/type/relationship.php' ); |
|
43 | -require_once( dirname( __FILE__ ) . 'entity/relationship.php' ); |
|
44 | -require_once( dirname( __FILE__ ) . 'entity/relationship/dynamic.php' ); |
|
45 | -require_once( dirname( __FILE__ ) . 'entity/restricted/visibilityi.php' ); |
|
46 | -require_once( dirname( __FILE__ ) . 'entity/site.php' ); |
|
47 | -require_once( dirname( __FILE__ ) . 'entity/term.php' ); |
|
48 | -require_once( dirname( __FILE__ ) . 'entity/term/id.php' ); |
|
49 | -require_once( dirname( __FILE__ ) . 'entity/user.php' ); |
|
50 | -require_once( dirname( __FILE__ ) . 'entity/user/role.php' ); |
|
51 | -require_once( dirname( __FILE__ ) . 'entity/user/role/name.php' ); |
|
52 | -require_once( dirname( __FILE__ ) . 'entity/user/roles.php' ); |
|
53 | -require_once( dirname( __FILE__ ) . 'entityish.php' ); |
|
54 | -require_once( dirname( __FILE__ ) . 'entityishi.php' ); |
|
55 | -require_once( dirname( __FILE__ ) . 'hierarchy.php' ); |
|
56 | -require_once( dirname( __FILE__ ) . 'hook/action.php' ); |
|
57 | -require_once( dirname( __FILE__ ) . 'hook/action/comment/new.php' ); |
|
58 | -require_once( dirname( __FILE__ ) . 'hook/action/post/publish.php' ); |
|
59 | -require_once( dirname( __FILE__ ) . 'hook/actioni.php' ); |
|
60 | -require_once( dirname( __FILE__ ) . 'hook/actions.php' ); |
|
61 | -require_once( dirname( __FILE__ ) . 'hook/arg.php' ); |
|
62 | -require_once( dirname( __FILE__ ) . 'hook/arg/current/post.php' ); |
|
63 | -require_once( dirname( __FILE__ ) . 'hook/arg/current/site.php' ); |
|
64 | -require_once( dirname( __FILE__ ) . 'hook/arg/current/user.php' ); |
|
65 | -require_once( dirname( __FILE__ ) . 'hook/arg/dynamic.php' ); |
|
66 | -require_once( dirname( __FILE__ ) . 'hook/condition.php' ); |
|
67 | -require_once( dirname( __FILE__ ) . 'hook/condition/entity/array/contains.php' ); |
|
68 | -require_once( dirname( __FILE__ ) . 'hook/condition/equals.php' ); |
|
69 | -require_once( dirname( __FILE__ ) . 'hook/condition/string/contains.php' ); |
|
70 | -require_once( dirname( __FILE__ ) . 'hook/conditioni.php' ); |
|
71 | -require_once( dirname( __FILE__ ) . 'hook/event.php' ); |
|
72 | -require_once( dirname( __FILE__ ) . 'hook/event/args.php' ); |
|
73 | -require_once( dirname( __FILE__ ) . 'hook/event/comment/leave.php' ); |
|
74 | -require_once( dirname( __FILE__ ) . 'hook/event/dynamic.php' ); |
|
75 | -require_once( dirname( __FILE__ ) . 'hook/event/media/upload.php' ); |
|
76 | -require_once( dirname( __FILE__ ) . 'hook/event/post/publish.php' ); |
|
77 | -require_once( dirname( __FILE__ ) . 'hook/event/user/register.php' ); |
|
78 | -require_once( dirname( __FILE__ ) . 'hook/event/user/visit.php' ); |
|
79 | -require_once( dirname( __FILE__ ) . 'hook/eventi.php' ); |
|
80 | -require_once( dirname( __FILE__ ) . 'hook/events.php' ); |
|
81 | -require_once( dirname( __FILE__ ) . 'hook/extension.php' ); |
|
82 | -require_once( dirname( __FILE__ ) . 'hook/extension/conditions.php' ); |
|
83 | -require_once( dirname( __FILE__ ) . 'hook/extension/periods.php' ); |
|
84 | -require_once( dirname( __FILE__ ) . 'hook/extension/reversei.php' ); |
|
85 | -require_once( dirname( __FILE__ ) . 'hook/extension/spami.php' ); |
|
86 | -require_once( dirname( __FILE__ ) . 'hook/firer.php' ); |
|
87 | -require_once( dirname( __FILE__ ) . 'hook/firer/reverse.php' ); |
|
88 | -require_once( dirname( __FILE__ ) . 'hook/firer/spam.php' ); |
|
89 | -require_once( dirname( __FILE__ ) . 'hook/fireri.php' ); |
|
90 | -require_once( dirname( __FILE__ ) . 'hook/reaction.php' ); |
|
91 | -require_once( dirname( __FILE__ ) . 'hook/reaction/options.php' ); |
|
92 | -require_once( dirname( __FILE__ ) . 'hook/reaction/storage.php' ); |
|
93 | -require_once( dirname( __FILE__ ) . 'hook/reaction/storage/options.php' ); |
|
94 | -require_once( dirname( __FILE__ ) . 'hook/reaction/storage/options/network.php' ); |
|
95 | -require_once( dirname( __FILE__ ) . 'hook/reaction/storagei.php' ); |
|
96 | -require_once( dirname( __FILE__ ) . 'hook/reaction/validator.php' ); |
|
97 | -require_once( dirname( __FILE__ ) . 'hook/reactioni.php' ); |
|
98 | -require_once( dirname( __FILE__ ) . 'hook/reactor.php' ); |
|
99 | -require_once( dirname( __FILE__ ) . 'hook/reactor/points.php' ); |
|
100 | -require_once( dirname( __FILE__ ) . 'hook/reactor/reversei.php' ); |
|
101 | -require_once( dirname( __FILE__ ) . 'hook/reactor/spami.php' ); |
|
102 | -require_once( dirname( __FILE__ ) . 'hook/retroactive/conditions.php' ); |
|
103 | -require_once( dirname( __FILE__ ) . 'hook/retroactive/query.php' ); |
|
104 | -require_once( dirname( __FILE__ ) . 'hook/retroactive/query/modifieri.php' ); |
|
105 | -require_once( dirname( __FILE__ ) . 'hook/retroactive/queryable.php' ); |
|
106 | -require_once( dirname( __FILE__ ) . 'hook/retroactive/queryi.php' ); |
|
107 | -require_once( dirname( __FILE__ ) . 'hook/router.php' ); |
|
108 | -require_once( dirname( __FILE__ ) . 'hook/settings.php' ); |
|
109 | -require_once( dirname( __FILE__ ) . 'hook/settingsi.php' ); |
|
110 | -require_once( dirname( __FILE__ ) . 'hook/validator/exception.php' ); |
|
111 | -require_once( dirname( __FILE__ ) . 'hooks.php' ); |
|
112 | -require_once( dirname( __FILE__ ) . 'query/builder/db/mysql.php' ); |
|
113 | -require_once( dirname( __FILE__ ) . 'spec.php' ); |
|
114 | -require_once( dirname( __FILE__ ) . 'specedi.php' ); |
|
13 | +require_once(dirname(__FILE__).'app.php'); |
|
14 | +require_once(dirname(__FILE__).'app/registry.php'); |
|
15 | +require_once(dirname(__FILE__).'class/autoloader.php'); |
|
16 | +require_once(dirname(__FILE__).'class/registry.php'); |
|
17 | +require_once(dirname(__FILE__).'class/registry/children.php'); |
|
18 | +require_once(dirname(__FILE__).'class/registry/childreni.php'); |
|
19 | +require_once(dirname(__FILE__).'class/registry/persistent.php'); |
|
20 | +require_once(dirname(__FILE__).'class/registryi.php'); |
|
21 | +require_once(dirname(__FILE__).'data/type.php'); |
|
22 | +require_once(dirname(__FILE__).'data/type/integer.php'); |
|
23 | +require_once(dirname(__FILE__).'data/type/text.php'); |
|
24 | +require_once(dirname(__FILE__).'data/typei.php'); |
|
25 | +require_once(dirname(__FILE__).'entity.php'); |
|
26 | +require_once(dirname(__FILE__).'entity/array.php'); |
|
27 | +require_once(dirname(__FILE__).'entity/attr.php'); |
|
28 | +require_once(dirname(__FILE__).'entity/childi.php'); |
|
29 | +require_once(dirname(__FILE__).'entity/comment.php'); |
|
30 | +require_once(dirname(__FILE__).'entity/comment/author.php'); |
|
31 | +require_once(dirname(__FILE__).'entity/comment/post.php'); |
|
32 | +require_once(dirname(__FILE__).'entity/enumerablei.php'); |
|
33 | +require_once(dirname(__FILE__).'entity/hierarchy.php'); |
|
34 | +require_once(dirname(__FILE__).'entity/hierarchyi.php'); |
|
35 | +require_once(dirname(__FILE__).'entity/parenti.php'); |
|
36 | +require_once(dirname(__FILE__).'entity/post.php'); |
|
37 | +require_once(dirname(__FILE__).'entity/post/author.php'); |
|
38 | +require_once(dirname(__FILE__).'entity/post/content.php'); |
|
39 | +require_once(dirname(__FILE__).'entity/post/terms.php'); |
|
40 | +require_once(dirname(__FILE__).'entity/post/type.php'); |
|
41 | +require_once(dirname(__FILE__).'entity/post/type/name.php'); |
|
42 | +require_once(dirname(__FILE__).'entity/post/type/relationship.php'); |
|
43 | +require_once(dirname(__FILE__).'entity/relationship.php'); |
|
44 | +require_once(dirname(__FILE__).'entity/relationship/dynamic.php'); |
|
45 | +require_once(dirname(__FILE__).'entity/restricted/visibilityi.php'); |
|
46 | +require_once(dirname(__FILE__).'entity/site.php'); |
|
47 | +require_once(dirname(__FILE__).'entity/term.php'); |
|
48 | +require_once(dirname(__FILE__).'entity/term/id.php'); |
|
49 | +require_once(dirname(__FILE__).'entity/user.php'); |
|
50 | +require_once(dirname(__FILE__).'entity/user/role.php'); |
|
51 | +require_once(dirname(__FILE__).'entity/user/role/name.php'); |
|
52 | +require_once(dirname(__FILE__).'entity/user/roles.php'); |
|
53 | +require_once(dirname(__FILE__).'entityish.php'); |
|
54 | +require_once(dirname(__FILE__).'entityishi.php'); |
|
55 | +require_once(dirname(__FILE__).'hierarchy.php'); |
|
56 | +require_once(dirname(__FILE__).'hook/action.php'); |
|
57 | +require_once(dirname(__FILE__).'hook/action/comment/new.php'); |
|
58 | +require_once(dirname(__FILE__).'hook/action/post/publish.php'); |
|
59 | +require_once(dirname(__FILE__).'hook/actioni.php'); |
|
60 | +require_once(dirname(__FILE__).'hook/actions.php'); |
|
61 | +require_once(dirname(__FILE__).'hook/arg.php'); |
|
62 | +require_once(dirname(__FILE__).'hook/arg/current/post.php'); |
|
63 | +require_once(dirname(__FILE__).'hook/arg/current/site.php'); |
|
64 | +require_once(dirname(__FILE__).'hook/arg/current/user.php'); |
|
65 | +require_once(dirname(__FILE__).'hook/arg/dynamic.php'); |
|
66 | +require_once(dirname(__FILE__).'hook/condition.php'); |
|
67 | +require_once(dirname(__FILE__).'hook/condition/entity/array/contains.php'); |
|
68 | +require_once(dirname(__FILE__).'hook/condition/equals.php'); |
|
69 | +require_once(dirname(__FILE__).'hook/condition/string/contains.php'); |
|
70 | +require_once(dirname(__FILE__).'hook/conditioni.php'); |
|
71 | +require_once(dirname(__FILE__).'hook/event.php'); |
|
72 | +require_once(dirname(__FILE__).'hook/event/args.php'); |
|
73 | +require_once(dirname(__FILE__).'hook/event/comment/leave.php'); |
|
74 | +require_once(dirname(__FILE__).'hook/event/dynamic.php'); |
|
75 | +require_once(dirname(__FILE__).'hook/event/media/upload.php'); |
|
76 | +require_once(dirname(__FILE__).'hook/event/post/publish.php'); |
|
77 | +require_once(dirname(__FILE__).'hook/event/user/register.php'); |
|
78 | +require_once(dirname(__FILE__).'hook/event/user/visit.php'); |
|
79 | +require_once(dirname(__FILE__).'hook/eventi.php'); |
|
80 | +require_once(dirname(__FILE__).'hook/events.php'); |
|
81 | +require_once(dirname(__FILE__).'hook/extension.php'); |
|
82 | +require_once(dirname(__FILE__).'hook/extension/conditions.php'); |
|
83 | +require_once(dirname(__FILE__).'hook/extension/periods.php'); |
|
84 | +require_once(dirname(__FILE__).'hook/extension/reversei.php'); |
|
85 | +require_once(dirname(__FILE__).'hook/extension/spami.php'); |
|
86 | +require_once(dirname(__FILE__).'hook/firer.php'); |
|
87 | +require_once(dirname(__FILE__).'hook/firer/reverse.php'); |
|
88 | +require_once(dirname(__FILE__).'hook/firer/spam.php'); |
|
89 | +require_once(dirname(__FILE__).'hook/fireri.php'); |
|
90 | +require_once(dirname(__FILE__).'hook/reaction.php'); |
|
91 | +require_once(dirname(__FILE__).'hook/reaction/options.php'); |
|
92 | +require_once(dirname(__FILE__).'hook/reaction/storage.php'); |
|
93 | +require_once(dirname(__FILE__).'hook/reaction/storage/options.php'); |
|
94 | +require_once(dirname(__FILE__).'hook/reaction/storage/options/network.php'); |
|
95 | +require_once(dirname(__FILE__).'hook/reaction/storagei.php'); |
|
96 | +require_once(dirname(__FILE__).'hook/reaction/validator.php'); |
|
97 | +require_once(dirname(__FILE__).'hook/reactioni.php'); |
|
98 | +require_once(dirname(__FILE__).'hook/reactor.php'); |
|
99 | +require_once(dirname(__FILE__).'hook/reactor/points.php'); |
|
100 | +require_once(dirname(__FILE__).'hook/reactor/reversei.php'); |
|
101 | +require_once(dirname(__FILE__).'hook/reactor/spami.php'); |
|
102 | +require_once(dirname(__FILE__).'hook/retroactive/conditions.php'); |
|
103 | +require_once(dirname(__FILE__).'hook/retroactive/query.php'); |
|
104 | +require_once(dirname(__FILE__).'hook/retroactive/query/modifieri.php'); |
|
105 | +require_once(dirname(__FILE__).'hook/retroactive/queryable.php'); |
|
106 | +require_once(dirname(__FILE__).'hook/retroactive/queryi.php'); |
|
107 | +require_once(dirname(__FILE__).'hook/router.php'); |
|
108 | +require_once(dirname(__FILE__).'hook/settings.php'); |
|
109 | +require_once(dirname(__FILE__).'hook/settingsi.php'); |
|
110 | +require_once(dirname(__FILE__).'hook/validator/exception.php'); |
|
111 | +require_once(dirname(__FILE__).'hooks.php'); |
|
112 | +require_once(dirname(__FILE__).'query/builder/db/mysql.php'); |
|
113 | +require_once(dirname(__FILE__).'spec.php'); |
|
114 | +require_once(dirname(__FILE__).'specedi.php'); |
|
115 | 115 | // } |
116 | 116 | |
117 | 117 | // EOF |
@@ -97,16 +97,16 @@ discard block |
||
97 | 97 | /** |
98 | 98 | * @since 1.0.0 |
99 | 99 | */ |
100 | - public function __construct( $slug, $parent = null ) { |
|
100 | + public function __construct($slug, $parent = null) { |
|
101 | 101 | |
102 | 102 | $this->slug = $slug; |
103 | 103 | $this->full_slug = $slug; |
104 | 104 | |
105 | - if ( $parent instanceof WordPoints_App ) { |
|
105 | + if ($parent instanceof WordPoints_App) { |
|
106 | 106 | $this->parent = $parent; |
107 | 107 | |
108 | - if ( 'apps' !== $this->parent->full_slug ) { |
|
109 | - $this->full_slug = $this->parent->full_slug . '-' . $this->full_slug; |
|
108 | + if ('apps' !== $this->parent->full_slug) { |
|
109 | + $this->full_slug = $this->parent->full_slug.'-'.$this->full_slug; |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
@@ -118,32 +118,32 @@ discard block |
||
118 | 118 | /** |
119 | 119 | * @since 1.0.0 |
120 | 120 | */ |
121 | - public function __isset( $var ) { |
|
122 | - return $this->sub_apps->is_registered( $var ); |
|
121 | + public function __isset($var) { |
|
122 | + return $this->sub_apps->is_registered($var); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
126 | 126 | * @since 1.0.0 |
127 | 127 | */ |
128 | - public function __get( $var ) { |
|
128 | + public function __get($var) { |
|
129 | 129 | |
130 | - if ( 'sub_apps' === $var ) { |
|
130 | + if ('sub_apps' === $var) { |
|
131 | 131 | return $this->$var; |
132 | 132 | } |
133 | 133 | |
134 | - $sub = $this->sub_apps->get( $var, array( $this ) ); |
|
134 | + $sub = $this->sub_apps->get($var, array($this)); |
|
135 | 135 | |
136 | - if ( ! $sub ) { |
|
136 | + if ( ! $sub) { |
|
137 | 137 | return null; |
138 | 138 | } |
139 | 139 | |
140 | 140 | if ( |
141 | - empty( $this->did_init[ $var ] ) |
|
141 | + empty($this->did_init[$var]) |
|
142 | 142 | && ! self::$main->silent |
143 | - && $this->should_do_registry_init( $sub ) |
|
143 | + && $this->should_do_registry_init($sub) |
|
144 | 144 | ) { |
145 | 145 | |
146 | - $is_protected_property = array_key_exists( $var, get_object_vars( $this ) ); |
|
146 | + $is_protected_property = array_key_exists($var, get_object_vars($this)); |
|
147 | 147 | |
148 | 148 | // When the below action is called it is possible that some hooked code |
149 | 149 | // may attempt to access the property that is being initialized. However, |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | // temporarily set this as a public property. However, we can't do this |
153 | 153 | // for properties that the class has declared, because otherwise it would |
154 | 154 | // be possible to modify and then unset protected class properties. |
155 | - if ( ! $is_protected_property ) { |
|
155 | + if ( ! $is_protected_property) { |
|
156 | 156 | $this->allow_set = true; |
157 | 157 | $this->$var = $sub; |
158 | 158 | $this->allow_set = false; |
@@ -168,25 +168,25 @@ discard block |
||
168 | 168 | * @param WordPoints_Class_RegistryI|WordPoints_Class_Registry_ChildrenI |
169 | 169 | * $registry The registry object. |
170 | 170 | */ |
171 | - do_action( "wordpoints_init_app_registry-{$this->full_slug}-{$var}", $sub ); |
|
171 | + do_action("wordpoints_init_app_registry-{$this->full_slug}-{$var}", $sub); |
|
172 | 172 | |
173 | 173 | // Because this property was public, it's possible that it might have |
174 | 174 | // been modified inadvertently. If this happens we give a warning. |
175 | - if ( $sub !== $this->$var ) { |
|
175 | + if ($sub !== $this->$var) { |
|
176 | 176 | _doing_it_wrong( |
177 | 177 | __METHOD__ |
178 | - , esc_html( "Do not modify the {$var} property directly." ) |
|
178 | + , esc_html("Do not modify the {$var} property directly.") |
|
179 | 179 | , '1.0.0' |
180 | 180 | ); |
181 | 181 | } |
182 | 182 | |
183 | - if ( ! $is_protected_property ) { |
|
183 | + if ( ! $is_protected_property) { |
|
184 | 184 | $this->allow_set = true; |
185 | - unset( $this->$var ); |
|
185 | + unset($this->$var); |
|
186 | 186 | $this->allow_set = false; |
187 | 187 | } |
188 | 188 | |
189 | - $this->did_init[ $var ] = true; |
|
189 | + $this->did_init[$var] = true; |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | return $sub; |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | /** |
196 | 196 | * @since 1.0.0 |
197 | 197 | */ |
198 | - public function __set( $var, $value ) { |
|
198 | + public function __set($var, $value) { |
|
199 | 199 | |
200 | - if ( $this->allow_set ) { |
|
200 | + if ($this->allow_set) { |
|
201 | 201 | $this->$var = $value; |
202 | 202 | } else { |
203 | 203 | _doing_it_wrong( |
@@ -211,10 +211,10 @@ discard block |
||
211 | 211 | /** |
212 | 212 | * @since 1.0.0 |
213 | 213 | */ |
214 | - public function __unset( $var ) { |
|
214 | + public function __unset($var) { |
|
215 | 215 | |
216 | - if ( $this->allow_set ) { |
|
217 | - unset( $this->$var ); |
|
216 | + if ($this->allow_set) { |
|
217 | + unset($this->$var); |
|
218 | 218 | } else { |
219 | 219 | _doing_it_wrong( |
220 | 220 | __METHOD__ |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * |
234 | 234 | * @return bool Whether to call the init action or not. |
235 | 235 | */ |
236 | - protected function should_do_registry_init( $registry ) { |
|
236 | + protected function should_do_registry_init($registry) { |
|
237 | 237 | return ( |
238 | 238 | $registry instanceof WordPoints_Class_RegistryI |
239 | 239 | || $registry instanceof WordPoints_Class_Registry_ChildrenI |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * |
258 | 258 | * @param WordPoints_App $app The app object. |
259 | 259 | */ |
260 | - do_action( "wordpoints_init_app-{$this->full_slug}", $this ); |
|
260 | + do_action("wordpoints_init_app-{$this->full_slug}", $this); |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @since 1.0.0 |
39 | 39 | */ |
40 | - public function __construct( $slug, WordPoints_Hook_ActionI $action = null ) { |
|
40 | + public function __construct($slug, WordPoints_Hook_ActionI $action = null) { |
|
41 | 41 | |
42 | - parent::__construct( $slug, $action ); |
|
42 | + parent::__construct($slug, $action); |
|
43 | 43 | |
44 | - $parts = wordpoints_parse_dynamic_slug( $this->slug ); |
|
44 | + $parts = wordpoints_parse_dynamic_slug($this->slug); |
|
45 | 45 | |
46 | - if ( $parts['dynamic'] ) { |
|
46 | + if ($parts['dynamic']) { |
|
47 | 47 | $this->arg_slug = $parts['generic']; |
48 | 48 | } else { |
49 | 49 | $this->arg_slug = $this->slug; |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | $value = parent::get_value(); |
60 | 60 | |
61 | 61 | // If not, then we check for an arg with the generic name. |
62 | - if ( null === $value && $this->action instanceof WordPoints_Hook_ActionI ) { |
|
63 | - $value = $this->action->get_arg_value( $this->arg_slug ); |
|
62 | + if (null === $value && $this->action instanceof WordPoints_Hook_ActionI) { |
|
63 | + $value = $this->action->get_arg_value($this->arg_slug); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | return $value; |
@@ -46,17 +46,17 @@ |
||
46 | 46 | */ |
47 | 47 | protected function get_entity_title() { |
48 | 48 | |
49 | - $parts = wordpoints_parse_dynamic_slug( $this->slug ); |
|
49 | + $parts = wordpoints_parse_dynamic_slug($this->slug); |
|
50 | 50 | |
51 | - if ( $parts['dynamic'] ) { |
|
51 | + if ($parts['dynamic']) { |
|
52 | 52 | $entity_slug = "{$this->generic_entity_slug}\\{$parts['dynamic']}"; |
53 | 53 | } else { |
54 | 54 | $entity_slug = $this->generic_entity_slug; |
55 | 55 | } |
56 | 56 | |
57 | - $entity = wordpoints_entities()->get( $entity_slug ); |
|
57 | + $entity = wordpoints_entities()->get($entity_slug); |
|
58 | 58 | |
59 | - if ( ! $entity instanceof WordPoints_Entity ) { |
|
59 | + if ( ! $entity instanceof WordPoints_Entity) { |
|
60 | 60 | return $this->slug; |
61 | 61 | } |
62 | 62 |