@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @since 1.0.0 |
28 | 28 | */ |
29 | 29 | public function __construct() { |
30 | - add_action( 'current_screen', array( $this, 'set_current_screen' ) ); |
|
30 | + add_action('current_screen', array($this, 'set_current_screen')); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @param WP_Screen $current_screen The WP_Screen object for the current screen. |
39 | 39 | */ |
40 | - public function set_current_screen( $current_screen ) { |
|
40 | + public function set_current_screen($current_screen) { |
|
41 | 41 | |
42 | - $screen = $this->get( $current_screen->id ); |
|
42 | + $screen = $this->get($current_screen->id); |
|
43 | 43 | |
44 | - if ( ! ( $screen instanceof WordPoints_Admin_Screen ) ) { |
|
44 | + if ( ! ($screen instanceof WordPoints_Admin_Screen)) { |
|
45 | 45 | return; |
46 | 46 | } |
47 | 47 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | add_action( |
51 | 51 | "load-{$current_screen->id}" |
52 | - , array( $this->current_screen, 'load' ) |
|
52 | + , array($this->current_screen, 'load') |
|
53 | 53 | ); |
54 | 54 | } |
55 | 55 |
@@ -14,18 +14,18 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @param WordPoints_App $app The main WordPoints app. |
16 | 16 | */ |
17 | -function wordpoints_hooks_register_admin_apps( $app ) { |
|
17 | +function wordpoints_hooks_register_admin_apps($app) { |
|
18 | 18 | |
19 | 19 | $apps = $app->sub_apps; |
20 | 20 | |
21 | - $apps->register( 'admin', 'WordPoints_App' ); |
|
21 | + $apps->register('admin', 'WordPoints_App'); |
|
22 | 22 | |
23 | 23 | /** @var WordPoints_App $admin */ |
24 | - $admin = $apps->get( 'admin' ); |
|
24 | + $admin = $apps->get('admin'); |
|
25 | 25 | |
26 | - $admin->sub_apps->register( 'screen', 'WordPoints_Admin_Screens' ); |
|
26 | + $admin->sub_apps->register('screen', 'WordPoints_Admin_Screens'); |
|
27 | 27 | } |
28 | -add_action( 'wordpoints_init_app-apps', 'wordpoints_hooks_register_admin_apps' ); |
|
28 | +add_action('wordpoints_init_app-apps', 'wordpoints_hooks_register_admin_apps'); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Register the admin screens. |
@@ -42,19 +42,19 @@ discard block |
||
42 | 42 | // Hooks page. |
43 | 43 | $id = add_submenu_page( |
44 | 44 | $wordpoints_menu |
45 | - , __( 'WordPoints — Points Types', 'wordpoints' ) |
|
46 | - , __( 'Points Types', 'wordpoints' ) |
|
45 | + , __('WordPoints — Points Types', 'wordpoints') |
|
46 | + , __('Points Types', 'wordpoints') |
|
47 | 47 | , 'manage_options' |
48 | 48 | , 'wordpoints_points_types' |
49 | - , array( $admin_screens, 'display' ) |
|
49 | + , array($admin_screens, 'display') |
|
50 | 50 | ); |
51 | 51 | |
52 | - if ( $id ) { |
|
53 | - $admin_screens->register( $id, 'WordPoints_Admin_Screen_Points_Types' ); |
|
52 | + if ($id) { |
|
53 | + $admin_screens->register($id, 'WordPoints_Admin_Screen_Points_Types'); |
|
54 | 54 | } |
55 | 55 | } |
56 | -add_action( 'admin_menu', 'wordpoints_hooks_api_admin_menu' ); |
|
57 | -add_action( 'network_admin_menu', 'wordpoints_hooks_api_admin_menu' ); |
|
56 | +add_action('admin_menu', 'wordpoints_hooks_api_admin_menu'); |
|
57 | +add_action('network_admin_menu', 'wordpoints_hooks_api_admin_menu'); |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * Register module admin scripts. |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | */ |
64 | 64 | function wordpoints_hooks_admin_register_scripts() { |
65 | 65 | |
66 | - $assets_url = wordpoints_modules_url( '/assets', dirname( __FILE__ ) ); |
|
66 | + $assets_url = wordpoints_modules_url('/assets', dirname(__FILE__)); |
|
67 | 67 | |
68 | 68 | // CSS |
69 | 69 | |
70 | 70 | wp_register_style( |
71 | 71 | 'wordpoints-hooks-admin' |
72 | - , $assets_url . '/css/hooks.css' |
|
73 | - , array( 'dashicons', 'wp-jquery-ui-dialog' ) |
|
72 | + , $assets_url.'/css/hooks.css' |
|
73 | + , array('dashicons', 'wp-jquery-ui-dialog') |
|
74 | 74 | , WORDPOINTS_VERSION |
75 | 75 | ); |
76 | 76 | |
@@ -78,15 +78,15 @@ discard block |
||
78 | 78 | |
79 | 79 | wp_register_script( |
80 | 80 | 'wordpoints-hooks-models' |
81 | - , $assets_url . '/js/hooks/models.js' |
|
82 | - , array( 'backbone', 'jquery-ui-dialog', 'wp-util' ) |
|
81 | + , $assets_url.'/js/hooks/models.js' |
|
82 | + , array('backbone', 'jquery-ui-dialog', 'wp-util') |
|
83 | 83 | , WORDPOINTS_VERSION |
84 | 84 | ); |
85 | 85 | |
86 | 86 | wp_register_script( |
87 | 87 | 'wordpoints-hooks-views' |
88 | - , $assets_url . '/js/hooks/views.js' |
|
89 | - , array( 'wordpoints-hooks-models' ) |
|
88 | + , $assets_url.'/js/hooks/views.js' |
|
89 | + , array('wordpoints-hooks-models') |
|
90 | 90 | , WORDPOINTS_VERSION |
91 | 91 | ); |
92 | 92 | |
@@ -94,15 +94,15 @@ discard block |
||
94 | 94 | 'wordpoints-hooks-views' |
95 | 95 | , 'WordPointsHooksAdminL10n' |
96 | 96 | , array( |
97 | - 'unexpectedError' => __( 'There was an unexpected error. Try reloading the page.', 'wordpoints' ), |
|
98 | - 'changesSaved' => __( 'Your changes have been saved.', 'wordpoints' ), |
|
97 | + 'unexpectedError' => __('There was an unexpected error. Try reloading the page.', 'wordpoints'), |
|
98 | + 'changesSaved' => __('Your changes have been saved.', 'wordpoints'), |
|
99 | 99 | /* translators: the name of the field that cannot be empty */ |
100 | - 'emptyField' => sprintf( __( '%s cannot be empty.', 'wordpoints' ), '{{ data.label }}' ), |
|
101 | - 'confirmDelete' => __( 'Are you sure that you want to delete this reaction? This action cannot be undone.', 'wordpoints' ), |
|
102 | - 'confirmTitle' => __( 'Are you sure?', 'wordpoints' ), |
|
103 | - 'deleteText' => __( 'Delete', 'wordpoints' ), |
|
104 | - 'cancelText' => __( 'Cancel', 'wordpoints' ), |
|
105 | - 'separator' => __( ' » ', 'wordpoints' ), |
|
100 | + 'emptyField' => sprintf(__('%s cannot be empty.', 'wordpoints'), '{{ data.label }}'), |
|
101 | + 'confirmDelete' => __('Are you sure that you want to delete this reaction? This action cannot be undone.', 'wordpoints'), |
|
102 | + 'confirmTitle' => __('Are you sure?', 'wordpoints'), |
|
103 | + 'deleteText' => __('Delete', 'wordpoints'), |
|
104 | + 'cancelText' => __('Cancel', 'wordpoints'), |
|
105 | + 'separator' => __(' » ', 'wordpoints'), |
|
106 | 106 | ) |
107 | 107 | ); |
108 | 108 | |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | <div class="view"> |
115 | 115 | <div class="title"></div> |
116 | 116 | <button type="button" class="edit button-secondary"> |
117 | - ' . esc_html__( 'Edit', 'wordpoints' ) . ' |
|
117 | + ' . esc_html__('Edit', 'wordpoints').' |
|
118 | 118 | </button> |
119 | 119 | <button type="button" class="close button-secondary"> |
120 | - ' . esc_html__( 'Close', 'wordpoints' ) . ' |
|
120 | + ' . esc_html__('Close', 'wordpoints').' |
|
121 | 121 | </button> |
122 | 122 | </div> |
123 | 123 | <div class="form"> |
@@ -136,16 +136,16 @@ discard block |
||
136 | 136 | </div> |
137 | 137 | <div class="action-buttons"> |
138 | 138 | <button type="button" class="save button-primary" disabled> |
139 | - ' . esc_html__( 'Save', 'wordpoints' ) . ' |
|
139 | + ' . esc_html__('Save', 'wordpoints').' |
|
140 | 140 | </button> |
141 | 141 | <button type="button" class="cancel button-secondary"> |
142 | - ' . esc_html__( 'Cancel', 'wordpoints' ) . ' |
|
142 | + ' . esc_html__('Cancel', 'wordpoints').' |
|
143 | 143 | </button> |
144 | 144 | <button type="button" class="close button-secondary"> |
145 | - ' . esc_html__( 'Close', 'wordpoints' ) . ' |
|
145 | + ' . esc_html__('Close', 'wordpoints').' |
|
146 | 146 | </button> |
147 | 147 | <button type="button" class="delete button-secondary"> |
148 | - ' . esc_html__( 'Delete', 'wordpoints' ) . ' |
|
148 | + ' . esc_html__('Delete', 'wordpoints').' |
|
149 | 149 | </button> |
150 | 150 | </div> |
151 | 151 | </div> |
@@ -193,15 +193,15 @@ discard block |
||
193 | 193 | |
194 | 194 | wp_register_script( |
195 | 195 | 'wordpoints-hooks-reactor-points' |
196 | - , $assets_url . '/js/hooks/reactors/points.js' |
|
197 | - , array( 'wordpoints-hooks-views' ) |
|
196 | + , $assets_url.'/js/hooks/reactors/points.js' |
|
197 | + , array('wordpoints-hooks-views') |
|
198 | 198 | , WORDPOINTS_VERSION |
199 | 199 | ); |
200 | 200 | |
201 | 201 | wp_register_script( |
202 | 202 | 'wordpoints-hooks-extension-conditions' |
203 | - , $assets_url . '/js/hooks/extensions/conditions.js' |
|
204 | - , array( 'wordpoints-hooks-views' ) |
|
203 | + , $assets_url.'/js/hooks/extensions/conditions.js' |
|
204 | + , array('wordpoints-hooks-views') |
|
205 | 205 | , WORDPOINTS_VERSION |
206 | 206 | ); |
207 | 207 | |
@@ -211,25 +211,25 @@ discard block |
||
211 | 211 | , ' |
212 | 212 | <script type="text/template" id="tmpl-wordpoints-hook-condition-groups"> |
213 | 213 | <div class="conditions-title"> |
214 | - <h4>' . esc_html__( 'Conditions', 'wordpoints' ) . '</h4> |
|
214 | + <h4>' . esc_html__('Conditions', 'wordpoints').'</h4> |
|
215 | 215 | <button type="button" class="add-new button-secondary button-link"> |
216 | - <span class="screen-reader-text">' . esc_html__( 'Add New Condition', 'wordpoints' ) . '</span> |
|
216 | + <span class="screen-reader-text">' . esc_html__('Add New Condition', 'wordpoints').'</span> |
|
217 | 217 | <span class="dashicons dashicons-plus"></span> |
218 | 218 | </button> |
219 | 219 | </div> |
220 | 220 | <div class="add-condition-form hidden"> |
221 | 221 | <div class="no-conditions hidden"> |
222 | - ' . esc_html__( 'No conditions available.', 'wordpoints' ) . ' |
|
222 | + ' . esc_html__('No conditions available.', 'wordpoints').' |
|
223 | 223 | </div> |
224 | 224 | <div class="condition-selectors"> |
225 | 225 | <div class="arg-selectors"></div> |
226 | 226 | <div class="condition-selector"></div> |
227 | 227 | </div> |
228 | - <button type="button" class="confirm-add-new button-secondary button-link" disabled aria-label="' . esc_attr__( 'Add Condition', 'wordpoints' ) . '"> |
|
229 | - ' . esc_html_x( 'Add', 'reaction condition', 'wordpoints' ) . ' |
|
228 | + <button type="button" class="confirm-add-new button-secondary button-link" disabled aria-label="' . esc_attr__('Add Condition', 'wordpoints').'"> |
|
229 | + ' . esc_html_x('Add', 'reaction condition', 'wordpoints').' |
|
230 | 230 | </button> |
231 | - <button type="button" class="cancel-add-new button-secondary button-link" aria-label="' . esc_attr__( 'Cancel Adding New Condition', 'wordpoints' ) . '"> |
|
232 | - ' . esc_html_x( 'Cancel', 'reaction condition', 'wordpoints' ) . ' |
|
231 | + <button type="button" class="cancel-add-new button-secondary button-link" aria-label="' . esc_attr__('Cancel Adding New Condition', 'wordpoints').'"> |
|
232 | + ' . esc_html_x('Cancel', 'reaction condition', 'wordpoints').' |
|
233 | 233 | </button> |
234 | 234 | </div> |
235 | 235 | <div class="condition-groups"></div> |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | <div class="condition-controls"> |
244 | 244 | <div class="condition-title"></div> |
245 | 245 | <button type="button" class="delete button-secondary button-link"> |
246 | - <span class="screen-reader-text">' . esc_html__( 'Remove Condition', 'wordpoints' ) . '</span> |
|
246 | + <span class="screen-reader-text">' . esc_html__('Remove Condition', 'wordpoints').'</span> |
|
247 | 247 | <span class="dashicons dashicons-no"></span> |
248 | 248 | </button> |
249 | 249 | </div> |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | ' |
260 | 260 | ); |
261 | 261 | } |
262 | -add_action( 'admin_init', 'wordpoints_hooks_admin_register_scripts' ); |
|
262 | +add_action('admin_init', 'wordpoints_hooks_admin_register_scripts'); |
|
263 | 263 | |
264 | 264 | /** |
265 | 265 | * Export the data for the scripts needed to make the hooks UI work. |
@@ -272,32 +272,32 @@ discard block |
||
272 | 272 | |
273 | 273 | $extensions_data = array(); |
274 | 274 | |
275 | - foreach ( $hooks->extensions->get_all() as $slug => $extension ) { |
|
275 | + foreach ($hooks->extensions->get_all() as $slug => $extension) { |
|
276 | 276 | |
277 | - if ( $extension instanceof WordPoints_Hook_Extension ) { |
|
278 | - $extensions_data[ $slug ] = $extension->get_ui_script_data(); |
|
277 | + if ($extension instanceof WordPoints_Hook_Extension) { |
|
278 | + $extensions_data[$slug] = $extension->get_ui_script_data(); |
|
279 | 279 | } |
280 | 280 | |
281 | - if ( wp_script_is( "wordpoints-hooks-extension-{$slug}", 'registered' ) ) { |
|
282 | - wp_enqueue_script( "wordpoints-hooks-extension-{$slug}" ); |
|
281 | + if (wp_script_is("wordpoints-hooks-extension-{$slug}", 'registered')) { |
|
282 | + wp_enqueue_script("wordpoints-hooks-extension-{$slug}"); |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | |
286 | 286 | $reactor_data = array(); |
287 | 287 | |
288 | - foreach ( $hooks->reactors->get_all() as $slug => $reactor ) { |
|
288 | + foreach ($hooks->reactors->get_all() as $slug => $reactor) { |
|
289 | 289 | |
290 | - if ( $reactor instanceof WordPoints_Hook_Reactor ) { |
|
291 | - $reactor_data[ $slug ] = array( |
|
290 | + if ($reactor instanceof WordPoints_Hook_Reactor) { |
|
291 | + $reactor_data[$slug] = array( |
|
292 | 292 | 'slug' => $reactor->get_slug(), |
293 | 293 | 'fields' => $reactor->get_settings_fields(), |
294 | 294 | 'arg_types' => $reactor->get_arg_types(), |
295 | - 'target_label' => __( 'Award To', 'wordpoints' ), |
|
295 | + 'target_label' => __('Award To', 'wordpoints'), |
|
296 | 296 | ); |
297 | 297 | } |
298 | 298 | |
299 | - if ( wp_script_is( "wordpoints-hooks-reactor-{$slug}", 'registered' ) ) { |
|
300 | - wp_enqueue_script( "wordpoints-hooks-reactor-{$slug}" ); |
|
299 | + if (wp_script_is("wordpoints-hooks-reactor-{$slug}", 'registered')) { |
|
300 | + wp_enqueue_script("wordpoints-hooks-reactor-{$slug}"); |
|
301 | 301 | } |
302 | 302 | } |
303 | 303 | |
@@ -309,28 +309,28 @@ discard block |
||
309 | 309 | $entity_children = $entities->children; |
310 | 310 | |
311 | 311 | /** @var WordPoints_Entity $entity */ |
312 | - foreach ( $entities->get_all() as $slug => $entity ) { |
|
312 | + foreach ($entities->get_all() as $slug => $entity) { |
|
313 | 313 | |
314 | 314 | $child_data = array(); |
315 | 315 | |
316 | 316 | /** @var WordPoints_EntityishI $child */ |
317 | - foreach ( $entity_children->get_children( $slug ) as $child_slug => $child ) { |
|
317 | + foreach ($entity_children->get_children($slug) as $child_slug => $child) { |
|
318 | 318 | |
319 | - $child_data[ $child_slug ] = array( |
|
319 | + $child_data[$child_slug] = array( |
|
320 | 320 | 'slug' => $child_slug, |
321 | 321 | 'title' => $child->get_title(), |
322 | 322 | ); |
323 | 323 | |
324 | - if ( $child instanceof WordPoints_Entity_Attr ) { |
|
324 | + if ($child instanceof WordPoints_Entity_Attr) { |
|
325 | 325 | |
326 | - $child_data[ $child_slug ]['_type'] = 'attr'; |
|
327 | - $child_data[ $child_slug ]['data_type'] = $child->get_data_type(); |
|
326 | + $child_data[$child_slug]['_type'] = 'attr'; |
|
327 | + $child_data[$child_slug]['data_type'] = $child->get_data_type(); |
|
328 | 328 | |
329 | - } elseif ( $child instanceof WordPoints_Entity_Relationship ) { |
|
329 | + } elseif ($child instanceof WordPoints_Entity_Relationship) { |
|
330 | 330 | |
331 | - $child_data[ $child_slug ]['_type'] = 'relationship'; |
|
332 | - $child_data[ $child_slug ]['primary'] = $child->get_primary_entity_slug(); |
|
333 | - $child_data[ $child_slug ]['secondary'] = $child->get_related_entity_slug(); |
|
331 | + $child_data[$child_slug]['_type'] = 'relationship'; |
|
332 | + $child_data[$child_slug]['primary'] = $child->get_primary_entity_slug(); |
|
333 | + $child_data[$child_slug]['secondary'] = $child->get_related_entity_slug(); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | /** |
@@ -341,10 +341,10 @@ discard block |
||
341 | 341 | * @param array $data The data for the entity child. |
342 | 342 | * @param WordPoints_Entityish $child The child's object. |
343 | 343 | */ |
344 | - $child_data[ $child_slug ] = apply_filters( 'wordpoints_hooks_ui_data_entity_child', $child_data[ $child_slug ], $child ); |
|
344 | + $child_data[$child_slug] = apply_filters('wordpoints_hooks_ui_data_entity_child', $child_data[$child_slug], $child); |
|
345 | 345 | } |
346 | 346 | |
347 | - $entities_data[ $slug ] = array( |
|
347 | + $entities_data[$slug] = array( |
|
348 | 348 | 'slug' => $slug, |
349 | 349 | 'title' => $entity->get_title(), |
350 | 350 | 'children' => $child_data, |
@@ -352,12 +352,12 @@ discard block |
||
352 | 352 | '_type' => 'entity', |
353 | 353 | ); |
354 | 354 | |
355 | - if ( $entity instanceof WordPoints_Entity_EnumerableI ) { |
|
355 | + if ($entity instanceof WordPoints_Entity_EnumerableI) { |
|
356 | 356 | |
357 | 357 | $values = array(); |
358 | 358 | |
359 | - foreach ( $entity->get_enumerated_values() as $value ) { |
|
360 | - if ( $entity->set_the_value( $value ) ) { |
|
359 | + foreach ($entity->get_enumerated_values() as $value) { |
|
360 | + if ($entity->set_the_value($value)) { |
|
361 | 361 | $values[] = array( |
362 | 362 | 'value' => $entity->get_the_id(), |
363 | 363 | 'label' => $entity->get_the_human_id(), |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | } |
366 | 366 | } |
367 | 367 | |
368 | - $entities_data[ $slug ]['values'] = $values; |
|
368 | + $entities_data[$slug]['values'] = $values; |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | /** |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | * @param array $data The data for the entity. |
375 | 375 | * @param WordPoints_Entity $entity The entity object. |
376 | 376 | */ |
377 | - $entities_data[ $slug ] = apply_filters( 'wordpoints_hooks_ui_data_entity', $entities_data[ $slug ], $entity ); |
|
377 | + $entities_data[$slug] = apply_filters('wordpoints_hooks_ui_data_entity', $entities_data[$slug], $entity); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | $data = array( |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | * |
396 | 396 | * @param array $data The data. |
397 | 397 | */ |
398 | - $data = apply_filters( 'wordpoints_hooks_ui_data', $data ); |
|
398 | + $data = apply_filters('wordpoints_hooks_ui_data', $data); |
|
399 | 399 | |
400 | 400 | wp_localize_script( |
401 | 401 | 'wordpoints-hooks-models' |
@@ -418,19 +418,19 @@ discard block |
||
418 | 418 | * |
419 | 419 | * @return string The HTML with templates appended. |
420 | 420 | */ |
421 | -function wordpoints_script_templates_filter( $html, $handle ) { |
|
421 | +function wordpoints_script_templates_filter($html, $handle) { |
|
422 | 422 | |
423 | 423 | global $wp_scripts; |
424 | 424 | |
425 | - $templates = $wp_scripts->get_data( $handle, 'wordpoints-templates' ); |
|
425 | + $templates = $wp_scripts->get_data($handle, 'wordpoints-templates'); |
|
426 | 426 | |
427 | - if ( $templates ) { |
|
427 | + if ($templates) { |
|
428 | 428 | $html .= $templates; |
429 | 429 | } |
430 | 430 | |
431 | 431 | return $html; |
432 | 432 | } |
433 | -add_filter( 'script_loader_tag', 'wordpoints_script_templates_filter', 10, 2 ); |
|
433 | +add_filter('script_loader_tag', 'wordpoints_script_templates_filter', 10, 2); |
|
434 | 434 | |
435 | 435 | /** |
436 | 436 | * Initialize the Ajax actions. |
@@ -439,10 +439,10 @@ discard block |
||
439 | 439 | */ |
440 | 440 | function wordpoints_hooks_admin_ajax() { |
441 | 441 | |
442 | - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { |
|
442 | + if (defined('DOING_AJAX') && DOING_AJAX) { |
|
443 | 443 | new WordPoints_Admin_Ajax_Hooks; |
444 | 444 | } |
445 | 445 | } |
446 | -add_action( 'admin_init', 'wordpoints_hooks_admin_ajax' ); |
|
446 | +add_action('admin_init', 'wordpoints_hooks_admin_ajax'); |
|
447 | 447 | |
448 | 448 | // EOF |
@@ -44,21 +44,21 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @since 1.0.0 |
46 | 46 | */ |
47 | -require_once( dirname( __FILE__ ) . '/includes/constants.php' ); |
|
47 | +require_once(dirname(__FILE__).'/includes/constants.php'); |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * The module's functions. |
51 | 51 | * |
52 | 52 | * @since 1.0.0 |
53 | 53 | */ |
54 | -require_once( dirname( __FILE__ ) . '/includes/functions.php' ); |
|
54 | +require_once(dirname(__FILE__).'/includes/functions.php'); |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * The module's actions and filters. |
58 | 58 | * |
59 | 59 | * @since 1.0.0 |
60 | 60 | */ |
61 | -require_once( dirname( __FILE__ ) . '/includes/actions.php' ); |
|
61 | +require_once(dirname(__FILE__).'/includes/actions.php'); |
|
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Class autoloader. |
@@ -67,22 +67,22 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @since 1.0.0 |
69 | 69 | */ |
70 | -require_once( dirname( __FILE__ ) . '/includes/classes/class/autoloader.php' ); |
|
70 | +require_once(dirname(__FILE__).'/includes/classes/class/autoloader.php'); |
|
71 | 71 | |
72 | 72 | // Register the classes to autoload. |
73 | 73 | WordPoints_Class_Autoloader::register_dir( |
74 | - dirname( __FILE__ ) . '/includes/classes' |
|
74 | + dirname(__FILE__).'/includes/classes' |
|
75 | 75 | , 'WordPoints_' |
76 | 76 | ); |
77 | 77 | |
78 | -if ( is_admin() ) { |
|
78 | +if (is_admin()) { |
|
79 | 79 | |
80 | 80 | /** |
81 | 81 | * Administration-side code. |
82 | 82 | * |
83 | 83 | * @since 1.0.0 |
84 | 84 | */ |
85 | - require_once( dirname( __FILE__ ) . '/admin/admin.php' ); |
|
85 | + require_once(dirname(__FILE__).'/admin/admin.php'); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | // EOF |
@@ -7,21 +7,21 @@ |
||
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | 9 | |
10 | -add_action( 'wordpoints_init_app-apps', 'wordpoints_apps_init' ); |
|
11 | -add_action( 'wordpoints_init_app-entities', 'wordpoints_entities_app_init' ); |
|
10 | +add_action('wordpoints_init_app-apps', 'wordpoints_apps_init'); |
|
11 | +add_action('wordpoints_init_app-entities', 'wordpoints_entities_app_init'); |
|
12 | 12 | |
13 | -add_action( 'wordpoints_init_app_registry-apps-entities', 'wordpoints_entities_init' ); |
|
14 | -add_action( 'wordpoints_init_app_registry-apps-data_types', 'wordpoints_data_types_init' ); |
|
13 | +add_action('wordpoints_init_app_registry-apps-entities', 'wordpoints_entities_init'); |
|
14 | +add_action('wordpoints_init_app_registry-apps-data_types', 'wordpoints_data_types_init'); |
|
15 | 15 | |
16 | -add_action( 'wordpoints_init_app_registry-hooks-firers', 'wordpoints_hook_firers_init' ); |
|
17 | -add_action( 'wordpoints_init_app_registry-hooks-events', 'wordpoints_hook_events_init' ); |
|
18 | -add_action( 'wordpoints_init_app_registry-hooks-actions', 'wordpoints_hook_actions_init' ); |
|
19 | -add_action( 'wordpoints_init_app_registry-hooks-reactors', 'wordpoints_hook_reactors_init' ); |
|
20 | -add_action( 'wordpoints_init_app_registry-hooks-extensions', 'wordpoints_hook_extension_init' ); |
|
21 | -add_action( 'wordpoints_init_app_registry-hooks-conditions', 'wordpoints_hook_conditions_init' ); |
|
16 | +add_action('wordpoints_init_app_registry-hooks-firers', 'wordpoints_hook_firers_init'); |
|
17 | +add_action('wordpoints_init_app_registry-hooks-events', 'wordpoints_hook_events_init'); |
|
18 | +add_action('wordpoints_init_app_registry-hooks-actions', 'wordpoints_hook_actions_init'); |
|
19 | +add_action('wordpoints_init_app_registry-hooks-reactors', 'wordpoints_hook_reactors_init'); |
|
20 | +add_action('wordpoints_init_app_registry-hooks-extensions', 'wordpoints_hook_extension_init'); |
|
21 | +add_action('wordpoints_init_app_registry-hooks-conditions', 'wordpoints_hook_conditions_init'); |
|
22 | 22 | |
23 | -add_action( 'wordpoints_modules_loaded', 'wordpoints_init_hooks' ); |
|
23 | +add_action('wordpoints_modules_loaded', 'wordpoints_init_hooks'); |
|
24 | 24 | |
25 | -add_filter( 'wordpoints_user_can_view_points_log', 'wordpoints_hooks_user_can_view_points_log' ); |
|
25 | +add_filter('wordpoints_user_can_view_points_log', 'wordpoints_hooks_user_can_view_points_log'); |
|
26 | 26 | |
27 | 27 | // EOF |
@@ -88,16 +88,16 @@ discard block |
||
88 | 88 | /** |
89 | 89 | * @since 1.0.0 |
90 | 90 | */ |
91 | - public function __construct( $slug, $parent = null ) { |
|
91 | + public function __construct($slug, $parent = null) { |
|
92 | 92 | |
93 | 93 | $this->slug = $slug; |
94 | 94 | $this->full_slug = $slug; |
95 | 95 | |
96 | - if ( $parent instanceof WordPoints_App ) { |
|
96 | + if ($parent instanceof WordPoints_App) { |
|
97 | 97 | $this->parent = $parent; |
98 | 98 | |
99 | - if ( 'apps' !== $this->parent->full_slug ) { |
|
100 | - $this->full_slug = $this->parent->full_slug . '-' . $this->full_slug; |
|
99 | + if ('apps' !== $this->parent->full_slug) { |
|
100 | + $this->full_slug = $this->parent->full_slug.'-'.$this->full_slug; |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
@@ -109,29 +109,29 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * @since 1.0.0 |
111 | 111 | */ |
112 | - public function __isset( $var ) { |
|
113 | - return $this->sub_apps->is_registered( $var ); |
|
112 | + public function __isset($var) { |
|
113 | + return $this->sub_apps->is_registered($var); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
117 | 117 | * @since 1.0.0 |
118 | 118 | */ |
119 | - public function __get( $var ) { |
|
119 | + public function __get($var) { |
|
120 | 120 | |
121 | - if ( 'sub_apps' === $var ) { |
|
121 | + if ('sub_apps' === $var) { |
|
122 | 122 | return $this->$var; |
123 | 123 | } |
124 | 124 | |
125 | - $sub = $this->sub_apps->get( $var, array( $this ) ); |
|
125 | + $sub = $this->sub_apps->get($var, array($this)); |
|
126 | 126 | |
127 | - if ( ! $sub ) { |
|
127 | + if ( ! $sub) { |
|
128 | 128 | return null; |
129 | 129 | } |
130 | 130 | |
131 | 131 | if ( |
132 | - empty( $this->did_init[ $var ] ) |
|
132 | + empty($this->did_init[$var]) |
|
133 | 133 | && ! self::$main->silent |
134 | - && $this->should_do_registry_init( $sub ) |
|
134 | + && $this->should_do_registry_init($sub) |
|
135 | 135 | ) { |
136 | 136 | |
137 | 137 | /** |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | * @param WordPoints_Class_RegistryI|WordPoints_Class_Registry_ChildrenI |
145 | 145 | * $registry The registry object. |
146 | 146 | */ |
147 | - do_action( "wordpoints_init_app_registry-{$this->full_slug}-{$var}", $sub ); |
|
147 | + do_action("wordpoints_init_app_registry-{$this->full_slug}-{$var}", $sub); |
|
148 | 148 | |
149 | - $this->did_init[ $var ] = true; |
|
149 | + $this->did_init[$var] = true; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | return $sub; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | /** |
156 | 156 | * @since 1.0.0 |
157 | 157 | */ |
158 | - public function __set( $var, $value ) { |
|
158 | + public function __set($var, $value) { |
|
159 | 159 | |
160 | 160 | _doing_it_wrong( |
161 | 161 | __METHOD__ |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | /** |
168 | 168 | * @since 1.0.0 |
169 | 169 | */ |
170 | - public function __unset( $var ) { |
|
170 | + public function __unset($var) { |
|
171 | 171 | |
172 | 172 | _doing_it_wrong( |
173 | 173 | __METHOD__ |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * |
186 | 186 | * @return bool Whether to call the init action or not. |
187 | 187 | */ |
188 | - protected function should_do_registry_init( $registry ) { |
|
188 | + protected function should_do_registry_init($registry) { |
|
189 | 189 | return ( |
190 | 190 | $registry instanceof WordPoints_Class_RegistryI |
191 | 191 | || $registry instanceof WordPoints_Class_Registry_ChildrenI |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * |
210 | 210 | * @param WordPoints_App $app The app object. |
211 | 211 | */ |
212 | - do_action( "wordpoints_init_app-{$this->full_slug}", $this ); |
|
212 | + do_action("wordpoints_init_app-{$this->full_slug}", $this); |
|
213 | 213 | } |
214 | 214 | } |
215 | 215 |
@@ -28,46 +28,46 @@ |
||
28 | 28 | /** |
29 | 29 | * @since 1.0.0 |
30 | 30 | */ |
31 | - public function __construct( $slug ) { |
|
31 | + public function __construct($slug) { |
|
32 | 32 | |
33 | 33 | $this->registry = new WordPoints_Class_Registry(); |
34 | 34 | |
35 | - parent::__construct( $slug ); |
|
35 | + parent::__construct($slug); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @since 1.0.0 |
40 | 40 | */ |
41 | - public function get_all( array $args = array() ) { |
|
42 | - return $this->registry->get_all( $args ); |
|
41 | + public function get_all(array $args = array()) { |
|
42 | + return $this->registry->get_all($args); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | 46 | * @since 1.0.0 |
47 | 47 | */ |
48 | - public function get( $slug, array $args = array() ) { |
|
49 | - return $this->registry->get( $slug, $args ); |
|
48 | + public function get($slug, array $args = array()) { |
|
49 | + return $this->registry->get($slug, $args); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * @since 1.0.0 |
54 | 54 | */ |
55 | - public function register( $slug, $class, array $args = array() ) { |
|
56 | - return $this->registry->register( $slug, $class, $args ); |
|
55 | + public function register($slug, $class, array $args = array()) { |
|
56 | + return $this->registry->register($slug, $class, $args); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | 60 | * @since 1.0.0 |
61 | 61 | */ |
62 | - public function deregister( $slug ) { |
|
63 | - $this->registry->deregister( $slug ); |
|
62 | + public function deregister($slug) { |
|
63 | + $this->registry->deregister($slug); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | 67 | * @since 1.0.0 |
68 | 68 | */ |
69 | - public function is_registered( $slug ) { |
|
70 | - return $this->registry->is_registered( $slug ); |
|
69 | + public function is_registered($slug) { |
|
70 | + return $this->registry->is_registered($slug); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 |
@@ -62,15 +62,15 @@ discard block |
||
62 | 62 | * @param string $dir The full path of the directory. |
63 | 63 | * @param string $prefix The prefix used for class names in this directory. |
64 | 64 | */ |
65 | - public static function register_dir( $dir, $prefix ) { |
|
65 | + public static function register_dir($dir, $prefix) { |
|
66 | 66 | |
67 | - if ( ! self::$added_action ) { |
|
68 | - add_action( 'wordpoints_modules_loaded', __CLASS__ . '::init', 0 ); |
|
67 | + if ( ! self::$added_action) { |
|
68 | + add_action('wordpoints_modules_loaded', __CLASS__.'::init', 0); |
|
69 | 69 | self::$added_action = true; |
70 | 70 | } |
71 | 71 | |
72 | - self::$prefixes[ $prefix ]['length'] = strlen( $prefix ); |
|
73 | - self::$prefixes[ $prefix ]['dirs'][] = trailingslashit( $dir ); |
|
72 | + self::$prefixes[$prefix]['length'] = strlen($prefix); |
|
73 | + self::$prefixes[$prefix]['dirs'][] = trailingslashit($dir); |
|
74 | 74 | |
75 | 75 | self::$sorted = false; |
76 | 76 | } |
@@ -86,31 +86,31 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @param string $class_name The name fo the class to load. |
88 | 88 | */ |
89 | - public static function load_class( $class_name ) { |
|
89 | + public static function load_class($class_name) { |
|
90 | 90 | |
91 | - if ( ! self::$sorted ) { |
|
92 | - arsort( self::$prefixes ); |
|
91 | + if ( ! self::$sorted) { |
|
92 | + arsort(self::$prefixes); |
|
93 | 93 | self::$sorted = true; |
94 | 94 | } |
95 | 95 | |
96 | - foreach ( self::$prefixes as $prefix => $data ) { |
|
96 | + foreach (self::$prefixes as $prefix => $data) { |
|
97 | 97 | |
98 | - if ( substr( $class_name, 0, $data['length'] ) !== $prefix ) { |
|
98 | + if (substr($class_name, 0, $data['length']) !== $prefix) { |
|
99 | 99 | continue; |
100 | 100 | } |
101 | 101 | |
102 | - $trimmed_class_name = substr( $class_name, $data['length'] ); |
|
102 | + $trimmed_class_name = substr($class_name, $data['length']); |
|
103 | 103 | |
104 | - $file_name = str_replace( '_', '/', strtolower( $trimmed_class_name ) ); |
|
105 | - $file_name = $file_name . '.php'; |
|
104 | + $file_name = str_replace('_', '/', strtolower($trimmed_class_name)); |
|
105 | + $file_name = $file_name.'.php'; |
|
106 | 106 | |
107 | - foreach ( $data['dirs'] as $dir ) { |
|
107 | + foreach ($data['dirs'] as $dir) { |
|
108 | 108 | |
109 | - if ( ! file_exists( $dir . $file_name ) ) { |
|
109 | + if ( ! file_exists($dir.$file_name)) { |
|
110 | 110 | continue; |
111 | 111 | } |
112 | 112 | |
113 | - require_once( $dir . $file_name ); |
|
113 | + require_once($dir.$file_name); |
|
114 | 114 | |
115 | 115 | return; |
116 | 116 | } |
@@ -135,16 +135,16 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public static function init() { |
137 | 137 | |
138 | - if ( function_exists( 'spl_autoload_register' ) ) { |
|
138 | + if (function_exists('spl_autoload_register')) { |
|
139 | 139 | |
140 | - spl_autoload_register( __CLASS__ . '::load_class' ); |
|
140 | + spl_autoload_register(__CLASS__.'::load_class'); |
|
141 | 141 | |
142 | 142 | } else { |
143 | 143 | |
144 | - foreach ( self::$prefixes as $prefix => $data ) { |
|
145 | - foreach ( $data['dirs'] as $dir ) { |
|
146 | - if ( file_exists( $dir . '/index.php' ) ) { |
|
147 | - require( $dir . '/index.php' ); |
|
144 | + foreach (self::$prefixes as $prefix => $data) { |
|
145 | + foreach ($data['dirs'] as $dir) { |
|
146 | + if (file_exists($dir.'/index.php')) { |
|
147 | + require($dir.'/index.php'); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | } |
@@ -30,39 +30,39 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * @since 1.0.0 |
32 | 32 | */ |
33 | - public function get_all( array $args = array() ) { |
|
34 | - return self::construct_with_args( $this->classes, $args ); |
|
33 | + public function get_all(array $args = array()) { |
|
34 | + return self::construct_with_args($this->classes, $args); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * @since 1.0.0 |
39 | 39 | */ |
40 | - public function get( $slug, array $args = array() ) { |
|
40 | + public function get($slug, array $args = array()) { |
|
41 | 41 | |
42 | - if ( ! isset( $this->classes[ $slug ] ) ) { |
|
42 | + if ( ! isset($this->classes[$slug])) { |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | |
46 | - if ( ! empty( $args ) ) { |
|
46 | + if ( ! empty($args)) { |
|
47 | 47 | |
48 | - array_unshift( $args, $slug ); |
|
48 | + array_unshift($args, $slug); |
|
49 | 49 | |
50 | 50 | return wordpoints_construct_class_with_args( |
51 | - $this->classes[ $slug ] |
|
51 | + $this->classes[$slug] |
|
52 | 52 | , $args |
53 | 53 | ); |
54 | 54 | |
55 | 55 | } else { |
56 | - return new $this->classes[ $slug ]( $slug ); |
|
56 | + return new $this->classes[$slug]($slug); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | 61 | * @since 1.0.0 |
62 | 62 | */ |
63 | - public function register( $slug, $class, array $args = array() ) { |
|
63 | + public function register($slug, $class, array $args = array()) { |
|
64 | 64 | |
65 | - $this->classes[ $slug ] = $class; |
|
65 | + $this->classes[$slug] = $class; |
|
66 | 66 | |
67 | 67 | return true; |
68 | 68 | } |
@@ -70,17 +70,17 @@ discard block |
||
70 | 70 | /** |
71 | 71 | * @since 1.0.0 |
72 | 72 | */ |
73 | - public function deregister( $slug ) { |
|
73 | + public function deregister($slug) { |
|
74 | 74 | |
75 | - unset( $this->classes[ $slug ] ); |
|
75 | + unset($this->classes[$slug]); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | 79 | * @since 1.0.0 |
80 | 80 | */ |
81 | - public function is_registered( $slug ) { |
|
81 | + public function is_registered($slug) { |
|
82 | 82 | |
83 | - return isset( $this->classes[ $slug ] ); |
|
83 | + return isset($this->classes[$slug]); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -94,24 +94,24 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @return object[] An array of the constructed objects. |
96 | 96 | */ |
97 | - public static function construct_with_args( array $classes, array $args ) { |
|
97 | + public static function construct_with_args(array $classes, array $args) { |
|
98 | 98 | |
99 | 99 | $objects = array(); |
100 | 100 | |
101 | - if ( empty( $args ) ) { |
|
101 | + if (empty($args)) { |
|
102 | 102 | |
103 | - foreach ( $classes as $slug => $class ) { |
|
104 | - $objects[ $slug ] = new $class( $slug ); |
|
103 | + foreach ($classes as $slug => $class) { |
|
104 | + $objects[$slug] = new $class($slug); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | } else { |
108 | 108 | |
109 | - array_unshift( $args, null ); |
|
109 | + array_unshift($args, null); |
|
110 | 110 | |
111 | - foreach ( $classes as $slug => $class ) { |
|
112 | - $objects[ $slug ] = wordpoints_construct_class_with_args( |
|
111 | + foreach ($classes as $slug => $class) { |
|
112 | + $objects[$slug] = wordpoints_construct_class_with_args( |
|
113 | 113 | $class |
114 | - , array( $slug ) + $args |
|
114 | + , array($slug) + $args |
|
115 | 115 | ); |
116 | 116 | } |
117 | 117 | } |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * @since 1.0.0 |
35 | 35 | */ |
36 | - public function get_all( array $args = array() ) { |
|
36 | + public function get_all(array $args = array()) { |
|
37 | 37 | |
38 | 38 | $items = array(); |
39 | 39 | |
40 | - foreach ( $this->classes as $parent_slug => $classes ) { |
|
41 | - $items[ $parent_slug ] = WordPoints_Class_Registry::construct_with_args( |
|
40 | + foreach ($this->classes as $parent_slug => $classes) { |
|
41 | + $items[$parent_slug] = WordPoints_Class_Registry::construct_with_args( |
|
42 | 42 | $classes |
43 | 43 | , $args |
44 | 44 | ); |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * @since 1.0.0 |
52 | 52 | */ |
53 | - public function get_children( $parent_slug, array $args = array() ) { |
|
53 | + public function get_children($parent_slug, array $args = array()) { |
|
54 | 54 | |
55 | 55 | $items = array(); |
56 | 56 | |
57 | - if ( isset( $this->classes[ $parent_slug ] ) ) { |
|
57 | + if (isset($this->classes[$parent_slug])) { |
|
58 | 58 | |
59 | 59 | $items = WordPoints_Class_Registry::construct_with_args( |
60 | - $this->classes[ $parent_slug ] |
|
60 | + $this->classes[$parent_slug] |
|
61 | 61 | , $args |
62 | 62 | ); |
63 | 63 | } |
@@ -68,29 +68,29 @@ discard block |
||
68 | 68 | /** |
69 | 69 | * @since 1.0.0 |
70 | 70 | */ |
71 | - public function get( $parent_slug, $slug, array $args = array() ) { |
|
71 | + public function get($parent_slug, $slug, array $args = array()) { |
|
72 | 72 | |
73 | - if ( ! isset( $this->classes[ $parent_slug ][ $slug ] ) ) { |
|
73 | + if ( ! isset($this->classes[$parent_slug][$slug])) { |
|
74 | 74 | return false; |
75 | 75 | } |
76 | 76 | |
77 | - $class = $this->classes[ $parent_slug ][ $slug ]; |
|
77 | + $class = $this->classes[$parent_slug][$slug]; |
|
78 | 78 | |
79 | - if ( empty( $args ) ) { |
|
80 | - return new $class( $slug ); |
|
79 | + if (empty($args)) { |
|
80 | + return new $class($slug); |
|
81 | 81 | } else { |
82 | - array_unshift( $args, $slug ); |
|
82 | + array_unshift($args, $slug); |
|
83 | 83 | |
84 | - return wordpoints_construct_class_with_args( $class, $args ); |
|
84 | + return wordpoints_construct_class_with_args($class, $args); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | 89 | * @since 1.0.0 |
90 | 90 | */ |
91 | - public function register( $parent_slug, $slug, $class, array $args = array() ) { |
|
91 | + public function register($parent_slug, $slug, $class, array $args = array()) { |
|
92 | 92 | |
93 | - $this->classes[ $parent_slug ][ $slug ] = $class; |
|
93 | + $this->classes[$parent_slug][$slug] = $class; |
|
94 | 94 | |
95 | 95 | return true; |
96 | 96 | } |
@@ -98,26 +98,26 @@ discard block |
||
98 | 98 | /** |
99 | 99 | * @since 1.0.0 |
100 | 100 | */ |
101 | - public function deregister( $parent_slug, $slug ) { |
|
102 | - unset( $this->classes[ $parent_slug ][ $slug ] ); |
|
101 | + public function deregister($parent_slug, $slug) { |
|
102 | + unset($this->classes[$parent_slug][$slug]); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | 106 | * @since 1.0.0 |
107 | 107 | */ |
108 | - public function deregister_children( $parent_slug ) { |
|
109 | - unset( $this->classes[ $parent_slug ] ); |
|
108 | + public function deregister_children($parent_slug) { |
|
109 | + unset($this->classes[$parent_slug]); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
113 | 113 | * @since 1.0.0 |
114 | 114 | */ |
115 | - public function is_registered( $parent_slug, $slug = null ) { |
|
115 | + public function is_registered($parent_slug, $slug = null) { |
|
116 | 116 | |
117 | - if ( isset( $slug ) ) { |
|
118 | - return isset( $this->classes[ $parent_slug ][ $slug ] ); |
|
117 | + if (isset($slug)) { |
|
118 | + return isset($this->classes[$parent_slug][$slug]); |
|
119 | 119 | } else { |
120 | - return isset( $this->classes[ $parent_slug ] ); |
|
120 | + return isset($this->classes[$parent_slug]); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | } |