@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function get_title() { |
23 | 23 | |
24 | - return __( 'Upload Media', 'wordpoints' ); |
|
24 | + return __('Upload Media', 'wordpoints'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function get_description() { |
31 | 31 | |
32 | - return __( 'When a file is uploaded to the Media Library.', 'wordpoints' ); |
|
32 | + return __('When a file is uploaded to the Media Library.', 'wordpoints'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @since 1.0.0 |
37 | 37 | */ |
38 | 38 | public function get_reversal_text() { |
39 | - return __( 'Media file deleted.', 'wordpoints' ); |
|
39 | + return __('Media file deleted.', 'wordpoints'); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 |
@@ -20,21 +20,21 @@ |
||
20 | 20 | * @since 1.0.0 |
21 | 21 | */ |
22 | 22 | public function get_title() { |
23 | - return __( 'Register', 'wordpoints' ); |
|
23 | + return __('Register', 'wordpoints'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @since 1.0.0 |
28 | 28 | */ |
29 | 29 | public function get_description() { |
30 | - return __( 'Registering.', 'wordpoints' ); |
|
30 | + return __('Registering.', 'wordpoints'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * @since 1.0.0 |
35 | 35 | */ |
36 | 36 | public function get_reversal_text() { |
37 | - return __( 'User removed.', 'wordpoints' ); |
|
37 | + return __('User removed.', 'wordpoints'); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 |
@@ -26,20 +26,20 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function get_title() { |
28 | 28 | |
29 | - $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
|
29 | + $parsed = wordpoints_parse_dynamic_slug($this->slug); |
|
30 | 30 | |
31 | - switch ( $parsed['dynamic'] ) { |
|
31 | + switch ($parsed['dynamic']) { |
|
32 | 32 | |
33 | 33 | case 'post': |
34 | - return __( 'Publish Post', 'wordpoints' ); |
|
34 | + return __('Publish Post', 'wordpoints'); |
|
35 | 35 | |
36 | 36 | case 'page': |
37 | - return __( 'Publish Page', 'wordpoints' ); |
|
37 | + return __('Publish Page', 'wordpoints'); |
|
38 | 38 | |
39 | 39 | default: |
40 | 40 | return sprintf( |
41 | 41 | // translators: singular name of the post type |
42 | - __( 'Publish %s', 'wordpoints' ) |
|
42 | + __('Publish %s', 'wordpoints') |
|
43 | 43 | , $this->get_entity_title() |
44 | 44 | ); |
45 | 45 | } |
@@ -50,20 +50,20 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function get_description() { |
52 | 52 | |
53 | - $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
|
53 | + $parsed = wordpoints_parse_dynamic_slug($this->slug); |
|
54 | 54 | |
55 | - switch ( $parsed['dynamic'] ) { |
|
55 | + switch ($parsed['dynamic']) { |
|
56 | 56 | |
57 | 57 | case 'post': |
58 | - return __( 'When a Post is published.', 'wordpoints' ); |
|
58 | + return __('When a Post is published.', 'wordpoints'); |
|
59 | 59 | |
60 | 60 | case 'page': |
61 | - return __( 'When a Page is published.', 'wordpoints' ); |
|
61 | + return __('When a Page is published.', 'wordpoints'); |
|
62 | 62 | |
63 | 63 | default: |
64 | 64 | return sprintf( |
65 | 65 | // translators: singular name of the post type |
66 | - __( 'When a %s is published.', 'wordpoints' ) |
|
66 | + __('When a %s is published.', 'wordpoints') |
|
67 | 67 | , $this->get_entity_title() |
68 | 68 | ); |
69 | 69 | } |
@@ -74,20 +74,20 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function get_reversal_text() { |
76 | 76 | |
77 | - $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
|
77 | + $parsed = wordpoints_parse_dynamic_slug($this->slug); |
|
78 | 78 | |
79 | - switch ( $parsed['dynamic'] ) { |
|
79 | + switch ($parsed['dynamic']) { |
|
80 | 80 | |
81 | 81 | case 'post': |
82 | - return __( 'Post removed.', 'wordpoints' ); |
|
82 | + return __('Post removed.', 'wordpoints'); |
|
83 | 83 | |
84 | 84 | case 'page': |
85 | - return __( 'Page removed.', 'wordpoints' ); |
|
85 | + return __('Page removed.', 'wordpoints'); |
|
86 | 86 | |
87 | 87 | default: |
88 | 88 | return sprintf( |
89 | 89 | // translators: singular name of the post type |
90 | - _x( '%s removed.', 'post type', 'wordpoints' ) |
|
90 | + _x('%s removed.', 'post type', 'wordpoints') |
|
91 | 91 | , $this->get_entity_title() |
92 | 92 | ); |
93 | 93 | } |
@@ -26,23 +26,23 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function get_title() { |
28 | 28 | |
29 | - $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
|
29 | + $parsed = wordpoints_parse_dynamic_slug($this->slug); |
|
30 | 30 | |
31 | - switch ( $parsed['dynamic'] ) { |
|
31 | + switch ($parsed['dynamic']) { |
|
32 | 32 | |
33 | 33 | case 'post': |
34 | - return __( 'Comment on a Post', 'wordpoints' ); |
|
34 | + return __('Comment on a Post', 'wordpoints'); |
|
35 | 35 | |
36 | 36 | case 'page': |
37 | - return __( 'Comment on a Page', 'wordpoints' ); |
|
37 | + return __('Comment on a Page', 'wordpoints'); |
|
38 | 38 | |
39 | 39 | case 'attachment': |
40 | - return __( 'Comment on a Media Upload', 'wordpoints' ); |
|
40 | + return __('Comment on a Media Upload', 'wordpoints'); |
|
41 | 41 | |
42 | 42 | default: |
43 | 43 | return sprintf( |
44 | 44 | // translators: singular name of the post type |
45 | - __( 'Comment on a %s', 'wordpoints' ) |
|
45 | + __('Comment on a %s', 'wordpoints') |
|
46 | 46 | , $this->get_entity_title() |
47 | 47 | ); |
48 | 48 | } |
@@ -53,23 +53,23 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function get_description() { |
55 | 55 | |
56 | - $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
|
56 | + $parsed = wordpoints_parse_dynamic_slug($this->slug); |
|
57 | 57 | |
58 | - switch ( $parsed['dynamic'] ) { |
|
58 | + switch ($parsed['dynamic']) { |
|
59 | 59 | |
60 | 60 | case 'post': |
61 | - return __( 'When a user leaves a comment on a Post.', 'wordpoints' ); |
|
61 | + return __('When a user leaves a comment on a Post.', 'wordpoints'); |
|
62 | 62 | |
63 | 63 | case 'page': |
64 | - return __( 'When a user leaves a comment on a Page.', 'wordpoints' ); |
|
64 | + return __('When a user leaves a comment on a Page.', 'wordpoints'); |
|
65 | 65 | |
66 | 66 | case 'attachment': |
67 | - return __( 'When a user leaves a comment on a file uploaded to the Media Library.', 'wordpoints' ); |
|
67 | + return __('When a user leaves a comment on a file uploaded to the Media Library.', 'wordpoints'); |
|
68 | 68 | |
69 | 69 | default: |
70 | 70 | return sprintf( |
71 | 71 | // translators: singular name of the post type |
72 | - __( 'When a user leaves a comment on a %s.', 'wordpoints' ) |
|
72 | + __('When a user leaves a comment on a %s.', 'wordpoints') |
|
73 | 73 | , $this->get_entity_title() |
74 | 74 | ); |
75 | 75 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @since 1.0.0 |
80 | 80 | */ |
81 | 81 | public function get_reversal_text() { |
82 | - return __( 'Comment removed.', 'wordpoints' ); |
|
82 | + return __('Comment removed.', 'wordpoints'); |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * |
22 | 22 | * @param WordPoints_Hook_Fire $fire The fire that was a miss. |
23 | 23 | */ |
24 | - public function after_miss( WordPoints_Hook_Fire $fire ); |
|
24 | + public function after_miss(WordPoints_Hook_Fire $fire); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | // EOF |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * @since 1.0.0 |
25 | 25 | */ |
26 | - public function should_hit( WordPoints_Hook_Fire $fire ) { |
|
26 | + public function should_hit(WordPoints_Hook_Fire $fire) { |
|
27 | 27 | |
28 | - if ( ! parent::should_hit( $fire ) ) { |
|
28 | + if ( ! parent::should_hit($fire)) { |
|
29 | 29 | |
30 | - $logs = $this->get_points_logs_to_be_reversed( $fire ); |
|
30 | + $logs = $this->get_points_logs_to_be_reversed($fire); |
|
31 | 31 | |
32 | - return count( $logs ) > 0; |
|
32 | + return count($logs) > 0; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | return true; |
@@ -38,16 +38,16 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * @since 1.0.0 |
40 | 40 | */ |
41 | - public function after_miss( WordPoints_Hook_Fire $fire ) { |
|
41 | + public function after_miss(WordPoints_Hook_Fire $fire) { |
|
42 | 42 | |
43 | - parent::after_miss( $fire ); |
|
43 | + parent::after_miss($fire); |
|
44 | 44 | |
45 | - if ( ! $this->get_settings_from_fire( $fire ) ) { |
|
45 | + if ( ! $this->get_settings_from_fire($fire)) { |
|
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
49 | - foreach ( $this->get_points_logs_to_be_reversed( $fire ) as $log ) { |
|
50 | - wordpoints_add_points_log_meta( $log->id, 'auto_reversed', 0 ); |
|
49 | + foreach ($this->get_points_logs_to_be_reversed($fire) as $log) { |
|
50 | + wordpoints_add_points_log_meta($log->id, 'auto_reversed', 0); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
@@ -60,23 +60,23 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return array The points logs to be reversed. |
62 | 62 | */ |
63 | - protected function get_points_logs_to_be_reversed( WordPoints_Hook_Fire $fire ) { |
|
63 | + protected function get_points_logs_to_be_reversed(WordPoints_Hook_Fire $fire) { |
|
64 | 64 | |
65 | - if ( isset( $fire->data[ $this->slug ]['points_logs'] ) ) { |
|
66 | - return $fire->data[ $this->slug ]['points_logs']; |
|
65 | + if (isset($fire->data[$this->slug]['points_logs'])) { |
|
66 | + return $fire->data[$this->slug]['points_logs']; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | $entity = $fire->event_args->get_primary_arg(); |
70 | 70 | |
71 | - if ( ! $entity ) { |
|
72 | - $fire->data[ $this->slug ]['points_logs'] = array(); |
|
71 | + if ( ! $entity) { |
|
72 | + $fire->data[$this->slug]['points_logs'] = array(); |
|
73 | 73 | return array(); |
74 | 74 | } |
75 | 75 | |
76 | 76 | $slug = $entity->get_slug(); |
77 | 77 | |
78 | - if ( ( $pos = strpos( $slug, '\\' ) ) ) { |
|
79 | - $slug = substr( $slug, 0, $pos ); |
|
78 | + if (($pos = strpos($slug, '\\'))) { |
|
79 | + $slug = substr($slug, 0, $pos); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | $meta_queries = array( |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | ) |
93 | 93 | ); |
94 | 94 | |
95 | - $log_type = $fire->reaction->get_meta( 'legacy_log_type' ); |
|
95 | + $log_type = $fire->reaction->get_meta('legacy_log_type'); |
|
96 | 96 | |
97 | - if ( ! $log_type ) { |
|
97 | + if ( ! $log_type) { |
|
98 | 98 | $log_type = $fire->reaction->get_event_slug(); |
99 | 99 | } |
100 | 100 | |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | |
108 | 108 | $logs = $query->get(); |
109 | 109 | |
110 | - if ( ! $logs ) { |
|
110 | + if ( ! $logs) { |
|
111 | 111 | $logs = array(); |
112 | 112 | } |
113 | 113 | |
114 | - $fire->data[ $this->slug ]['points_logs'] = $logs; |
|
114 | + $fire->data[$this->slug]['points_logs'] = $logs; |
|
115 | 115 | |
116 | 116 | return $logs; |
117 | 117 | } |
@@ -10,123 +10,123 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // auto-generated { |
13 | -$dir = dirname( __FILE__ ); |
|
14 | -require_once( $dir . '/specedi.php' ); |
|
15 | -require_once( $dir . '/hook/settingsi.php' ); |
|
16 | -require_once( $dir . '/hook/retroactive/queryi.php' ); |
|
17 | -require_once( $dir . '/hook/retroactive/query/modifieri.php' ); |
|
18 | -require_once( $dir . '/hook/reactioni.php' ); |
|
19 | -require_once( $dir . '/hook/reaction/storei.php' ); |
|
20 | -require_once( $dir . '/hook/extension/miss/listeneri.php' ); |
|
21 | -require_once( $dir . '/hook/extension/hit/listeneri.php' ); |
|
22 | -require_once( $dir . '/hook/eventi.php' ); |
|
23 | -require_once( $dir . '/hook/event/reversingi.php' ); |
|
24 | -require_once( $dir . '/hook/conditioni.php' ); |
|
25 | -require_once( $dir . '/hook/actioni.php' ); |
|
26 | -require_once( $dir . '/entityishi.php' ); |
|
27 | -require_once( $dir . '/entityish/storedi.php' ); |
|
28 | -require_once( $dir . '/entity/restricted/visibilityi.php' ); |
|
29 | -require_once( $dir . '/entity/parenti.php' ); |
|
30 | -require_once( $dir . '/entity/hierarchyi.php' ); |
|
31 | -require_once( $dir . '/entity/enumerablei.php' ); |
|
32 | -require_once( $dir . '/entity/childi.php' ); |
|
33 | -require_once( $dir . '/data/typei.php' ); |
|
34 | -require_once( $dir . '/class/registryi.php' ); |
|
35 | -require_once( $dir . '/class/registry/childreni.php' ); |
|
36 | -require_once( $dir . '/app.php' ); |
|
37 | -require_once( $dir . '/app/registry.php' ); |
|
38 | -require_once( $dir . '/class/autoloader.php' ); |
|
39 | -require_once( $dir . '/class/registry.php' ); |
|
40 | -require_once( $dir . '/class/registry/children.php' ); |
|
41 | -require_once( $dir . '/class/registry/persistent.php' ); |
|
42 | -require_once( $dir . '/data/type.php' ); |
|
43 | -require_once( $dir . '/data/type/integer.php' ); |
|
44 | -require_once( $dir . '/data/type/text.php' ); |
|
45 | -require_once( $dir . '/db/query.php' ); |
|
46 | -require_once( $dir . '/entityish.php' ); |
|
47 | -require_once( $dir . '/entity.php' ); |
|
48 | -require_once( $dir . '/entity/relationship.php' ); |
|
49 | -require_once( $dir . '/entity/relationship/dynamic.php' ); |
|
50 | -require_once( $dir . '/entity/relationship/stored/field.php' ); |
|
51 | -require_once( $dir . '/entity/stored/array.php' ); |
|
52 | -require_once( $dir . '/entity/stored/db/table.php' ); |
|
53 | -require_once( $dir . '/entity/array.php' ); |
|
54 | -require_once( $dir . '/entity/attr.php' ); |
|
55 | -require_once( $dir . '/entity/attr/field.php' ); |
|
56 | -require_once( $dir . '/entity/change.php' ); |
|
57 | -require_once( $dir . '/entity/comment.php' ); |
|
58 | -require_once( $dir . '/entity/comment/author.php' ); |
|
59 | -require_once( $dir . '/entity/comment/post.php' ); |
|
60 | -require_once( $dir . '/entity/context.php' ); |
|
61 | -require_once( $dir . '/entity/context/network.php' ); |
|
62 | -require_once( $dir . '/entity/context/site.php' ); |
|
63 | -require_once( $dir . '/entity/hierarchy.php' ); |
|
64 | -require_once( $dir . '/entity/post.php' ); |
|
65 | -require_once( $dir . '/entity/post/author.php' ); |
|
66 | -require_once( $dir . '/entity/post/content.php' ); |
|
67 | -require_once( $dir . '/entity/post/terms.php' ); |
|
68 | -require_once( $dir . '/entity/post/type.php' ); |
|
69 | -require_once( $dir . '/entity/post/type/name.php' ); |
|
70 | -require_once( $dir . '/entity/post/type/relationship.php' ); |
|
71 | -require_once( $dir . '/entity/site.php' ); |
|
72 | -require_once( $dir . '/entity/term.php' ); |
|
73 | -require_once( $dir . '/entity/term/id.php' ); |
|
74 | -require_once( $dir . '/entity/user.php' ); |
|
75 | -require_once( $dir . '/entity/user/role.php' ); |
|
76 | -require_once( $dir . '/entity/user/role/name.php' ); |
|
77 | -require_once( $dir . '/entity/user/roles.php' ); |
|
78 | -require_once( $dir . '/hierarchy.php' ); |
|
79 | -require_once( $dir . '/hook/action.php' ); |
|
80 | -require_once( $dir . '/hook/action/comment/new.php' ); |
|
81 | -require_once( $dir . '/hook/action/post/publish.php' ); |
|
82 | -require_once( $dir . '/hook/actions.php' ); |
|
83 | -require_once( $dir . '/hook/arg.php' ); |
|
84 | -require_once( $dir . '/hook/arg/current/post.php' ); |
|
85 | -require_once( $dir . '/hook/arg/current/site.php' ); |
|
86 | -require_once( $dir . '/hook/arg/current/user.php' ); |
|
87 | -require_once( $dir . '/hook/arg/dynamic.php' ); |
|
88 | -require_once( $dir . '/hook/condition.php' ); |
|
89 | -require_once( $dir . '/hook/condition/entity/array/contains.php' ); |
|
90 | -require_once( $dir . '/hook/condition/equals.php' ); |
|
91 | -require_once( $dir . '/hook/condition/string/contains.php' ); |
|
92 | -require_once( $dir . '/hook/event.php' ); |
|
93 | -require_once( $dir . '/hook/event/dynamic.php' ); |
|
94 | -require_once( $dir . '/hook/event/args.php' ); |
|
95 | -require_once( $dir . '/hook/event/comment/leave.php' ); |
|
96 | -require_once( $dir . '/hook/event/media/upload.php' ); |
|
97 | -require_once( $dir . '/hook/event/post/publish.php' ); |
|
98 | -require_once( $dir . '/hook/event/user/register.php' ); |
|
99 | -require_once( $dir . '/hook/event/user/visit.php' ); |
|
100 | -require_once( $dir . '/hook/events.php' ); |
|
101 | -require_once( $dir . '/hook/extension.php' ); |
|
102 | -require_once( $dir . '/hook/extension/blocker.php' ); |
|
103 | -require_once( $dir . '/hook/extension/conditions.php' ); |
|
104 | -require_once( $dir . '/hook/extension/periods.php' ); |
|
105 | -require_once( $dir . '/hook/extension/repeat/blocker.php' ); |
|
106 | -require_once( $dir . '/hook/extension/reversals.php' ); |
|
107 | -require_once( $dir . '/hook/extension/reversals/legacy/points.php' ); |
|
108 | -require_once( $dir . '/hook/fire.php' ); |
|
109 | -require_once( $dir . '/hook/hit/logger.php' ); |
|
110 | -require_once( $dir . '/hook/hit/query.php' ); |
|
111 | -require_once( $dir . '/hook/reaction.php' ); |
|
112 | -require_once( $dir . '/hook/reaction/options.php' ); |
|
113 | -require_once( $dir . '/hook/reaction/store.php' ); |
|
114 | -require_once( $dir . '/hook/reaction/store/options.php' ); |
|
115 | -require_once( $dir . '/hook/reaction/store/options/network.php' ); |
|
116 | -require_once( $dir . '/hook/reaction/validator.php' ); |
|
117 | -require_once( $dir . '/hook/reactor.php' ); |
|
118 | -require_once( $dir . '/hook/reactor/points.php' ); |
|
119 | -require_once( $dir . '/hook/reactor/points/legacy.php' ); |
|
120 | -require_once( $dir . '/hook/retroactive/conditions.php' ); |
|
121 | -require_once( $dir . '/hook/retroactive/query.php' ); |
|
122 | -require_once( $dir . '/hook/retroactive/queryable.php' ); |
|
123 | -require_once( $dir . '/hook/router.php' ); |
|
124 | -require_once( $dir . '/hook/settings.php' ); |
|
125 | -require_once( $dir . '/hook/validator/exception.php' ); |
|
126 | -require_once( $dir . '/hooks.php' ); |
|
127 | -require_once( $dir . '/query/builder/db/mysql.php' ); |
|
128 | -require_once( $dir . '/spec.php' ); |
|
129 | -require_once( $dir . '/wpdb/wrapper.php' ); |
|
13 | +$dir = dirname(__FILE__); |
|
14 | +require_once($dir.'/specedi.php'); |
|
15 | +require_once($dir.'/hook/settingsi.php'); |
|
16 | +require_once($dir.'/hook/retroactive/queryi.php'); |
|
17 | +require_once($dir.'/hook/retroactive/query/modifieri.php'); |
|
18 | +require_once($dir.'/hook/reactioni.php'); |
|
19 | +require_once($dir.'/hook/reaction/storei.php'); |
|
20 | +require_once($dir.'/hook/extension/miss/listeneri.php'); |
|
21 | +require_once($dir.'/hook/extension/hit/listeneri.php'); |
|
22 | +require_once($dir.'/hook/eventi.php'); |
|
23 | +require_once($dir.'/hook/event/reversingi.php'); |
|
24 | +require_once($dir.'/hook/conditioni.php'); |
|
25 | +require_once($dir.'/hook/actioni.php'); |
|
26 | +require_once($dir.'/entityishi.php'); |
|
27 | +require_once($dir.'/entityish/storedi.php'); |
|
28 | +require_once($dir.'/entity/restricted/visibilityi.php'); |
|
29 | +require_once($dir.'/entity/parenti.php'); |
|
30 | +require_once($dir.'/entity/hierarchyi.php'); |
|
31 | +require_once($dir.'/entity/enumerablei.php'); |
|
32 | +require_once($dir.'/entity/childi.php'); |
|
33 | +require_once($dir.'/data/typei.php'); |
|
34 | +require_once($dir.'/class/registryi.php'); |
|
35 | +require_once($dir.'/class/registry/childreni.php'); |
|
36 | +require_once($dir.'/app.php'); |
|
37 | +require_once($dir.'/app/registry.php'); |
|
38 | +require_once($dir.'/class/autoloader.php'); |
|
39 | +require_once($dir.'/class/registry.php'); |
|
40 | +require_once($dir.'/class/registry/children.php'); |
|
41 | +require_once($dir.'/class/registry/persistent.php'); |
|
42 | +require_once($dir.'/data/type.php'); |
|
43 | +require_once($dir.'/data/type/integer.php'); |
|
44 | +require_once($dir.'/data/type/text.php'); |
|
45 | +require_once($dir.'/db/query.php'); |
|
46 | +require_once($dir.'/entityish.php'); |
|
47 | +require_once($dir.'/entity.php'); |
|
48 | +require_once($dir.'/entity/relationship.php'); |
|
49 | +require_once($dir.'/entity/relationship/dynamic.php'); |
|
50 | +require_once($dir.'/entity/relationship/stored/field.php'); |
|
51 | +require_once($dir.'/entity/stored/array.php'); |
|
52 | +require_once($dir.'/entity/stored/db/table.php'); |
|
53 | +require_once($dir.'/entity/array.php'); |
|
54 | +require_once($dir.'/entity/attr.php'); |
|
55 | +require_once($dir.'/entity/attr/field.php'); |
|
56 | +require_once($dir.'/entity/change.php'); |
|
57 | +require_once($dir.'/entity/comment.php'); |
|
58 | +require_once($dir.'/entity/comment/author.php'); |
|
59 | +require_once($dir.'/entity/comment/post.php'); |
|
60 | +require_once($dir.'/entity/context.php'); |
|
61 | +require_once($dir.'/entity/context/network.php'); |
|
62 | +require_once($dir.'/entity/context/site.php'); |
|
63 | +require_once($dir.'/entity/hierarchy.php'); |
|
64 | +require_once($dir.'/entity/post.php'); |
|
65 | +require_once($dir.'/entity/post/author.php'); |
|
66 | +require_once($dir.'/entity/post/content.php'); |
|
67 | +require_once($dir.'/entity/post/terms.php'); |
|
68 | +require_once($dir.'/entity/post/type.php'); |
|
69 | +require_once($dir.'/entity/post/type/name.php'); |
|
70 | +require_once($dir.'/entity/post/type/relationship.php'); |
|
71 | +require_once($dir.'/entity/site.php'); |
|
72 | +require_once($dir.'/entity/term.php'); |
|
73 | +require_once($dir.'/entity/term/id.php'); |
|
74 | +require_once($dir.'/entity/user.php'); |
|
75 | +require_once($dir.'/entity/user/role.php'); |
|
76 | +require_once($dir.'/entity/user/role/name.php'); |
|
77 | +require_once($dir.'/entity/user/roles.php'); |
|
78 | +require_once($dir.'/hierarchy.php'); |
|
79 | +require_once($dir.'/hook/action.php'); |
|
80 | +require_once($dir.'/hook/action/comment/new.php'); |
|
81 | +require_once($dir.'/hook/action/post/publish.php'); |
|
82 | +require_once($dir.'/hook/actions.php'); |
|
83 | +require_once($dir.'/hook/arg.php'); |
|
84 | +require_once($dir.'/hook/arg/current/post.php'); |
|
85 | +require_once($dir.'/hook/arg/current/site.php'); |
|
86 | +require_once($dir.'/hook/arg/current/user.php'); |
|
87 | +require_once($dir.'/hook/arg/dynamic.php'); |
|
88 | +require_once($dir.'/hook/condition.php'); |
|
89 | +require_once($dir.'/hook/condition/entity/array/contains.php'); |
|
90 | +require_once($dir.'/hook/condition/equals.php'); |
|
91 | +require_once($dir.'/hook/condition/string/contains.php'); |
|
92 | +require_once($dir.'/hook/event.php'); |
|
93 | +require_once($dir.'/hook/event/dynamic.php'); |
|
94 | +require_once($dir.'/hook/event/args.php'); |
|
95 | +require_once($dir.'/hook/event/comment/leave.php'); |
|
96 | +require_once($dir.'/hook/event/media/upload.php'); |
|
97 | +require_once($dir.'/hook/event/post/publish.php'); |
|
98 | +require_once($dir.'/hook/event/user/register.php'); |
|
99 | +require_once($dir.'/hook/event/user/visit.php'); |
|
100 | +require_once($dir.'/hook/events.php'); |
|
101 | +require_once($dir.'/hook/extension.php'); |
|
102 | +require_once($dir.'/hook/extension/blocker.php'); |
|
103 | +require_once($dir.'/hook/extension/conditions.php'); |
|
104 | +require_once($dir.'/hook/extension/periods.php'); |
|
105 | +require_once($dir.'/hook/extension/repeat/blocker.php'); |
|
106 | +require_once($dir.'/hook/extension/reversals.php'); |
|
107 | +require_once($dir.'/hook/extension/reversals/legacy/points.php'); |
|
108 | +require_once($dir.'/hook/fire.php'); |
|
109 | +require_once($dir.'/hook/hit/logger.php'); |
|
110 | +require_once($dir.'/hook/hit/query.php'); |
|
111 | +require_once($dir.'/hook/reaction.php'); |
|
112 | +require_once($dir.'/hook/reaction/options.php'); |
|
113 | +require_once($dir.'/hook/reaction/store.php'); |
|
114 | +require_once($dir.'/hook/reaction/store/options.php'); |
|
115 | +require_once($dir.'/hook/reaction/store/options/network.php'); |
|
116 | +require_once($dir.'/hook/reaction/validator.php'); |
|
117 | +require_once($dir.'/hook/reactor.php'); |
|
118 | +require_once($dir.'/hook/reactor/points.php'); |
|
119 | +require_once($dir.'/hook/reactor/points/legacy.php'); |
|
120 | +require_once($dir.'/hook/retroactive/conditions.php'); |
|
121 | +require_once($dir.'/hook/retroactive/query.php'); |
|
122 | +require_once($dir.'/hook/retroactive/queryable.php'); |
|
123 | +require_once($dir.'/hook/router.php'); |
|
124 | +require_once($dir.'/hook/settings.php'); |
|
125 | +require_once($dir.'/hook/validator/exception.php'); |
|
126 | +require_once($dir.'/hooks.php'); |
|
127 | +require_once($dir.'/query/builder/db/mysql.php'); |
|
128 | +require_once($dir.'/spec.php'); |
|
129 | +require_once($dir.'/wpdb/wrapper.php'); |
|
130 | 130 | // } |
131 | 131 | |
132 | 132 | // EOF |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @param WordPoints_Class_Registry_Persistent $reactors The reactors registry. |
35 | 35 | */ |
36 | -function wordpoints_hook_reactors_init( $reactors ) { |
|
36 | +function wordpoints_hook_reactors_init($reactors) { |
|
37 | 37 | |
38 | - $reactors->register( 'points', 'WordPoints_Hook_Reactor_Points' ); |
|
39 | - $reactors->register( 'points_legacy', 'WordPoints_Hook_Reactor_Points_Legacy' ); |
|
38 | + $reactors->register('points', 'WordPoints_Hook_Reactor_Points'); |
|
39 | + $reactors->register('points_legacy', 'WordPoints_Hook_Reactor_Points_Legacy'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @param WordPoints_Class_Registry_Children $reaction_stores The store registry. |
50 | 50 | */ |
51 | -function wordpoints_hook_reaction_stores_init( $reaction_stores ) { |
|
51 | +function wordpoints_hook_reaction_stores_init($reaction_stores) { |
|
52 | 52 | |
53 | 53 | $reaction_stores->register( |
54 | 54 | 'standard' |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | , 'WordPoints_Hook_Reaction_Store_Options' |
57 | 57 | ); |
58 | 58 | |
59 | - if ( is_wordpoints_network_active() ) { |
|
59 | + if (is_wordpoints_network_active()) { |
|
60 | 60 | $reaction_stores->register( |
61 | 61 | 'network' |
62 | 62 | , 'points' |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @param WordPoints_Class_Registry_Persistent $extensions The extension registry. |
76 | 76 | */ |
77 | -function wordpoints_hook_extension_init( $extensions ) { |
|
78 | - |
|
79 | - $extensions->register( 'blocker', 'WordPoints_Hook_Extension_Blocker' ); |
|
80 | - $extensions->register( 'repeat_blocker', 'WordPoints_Hook_Extension_Repeat_Blocker' ); |
|
81 | - $extensions->register( 'reversals', 'WordPoints_Hook_Extension_Reversals' ); |
|
82 | - $extensions->register( 'reversals_legacy_points', 'WordPoints_Hook_Extension_Reversals_Legacy_Points' ); |
|
83 | - $extensions->register( 'conditions', 'WordPoints_Hook_Extension_Conditions' ); |
|
84 | - $extensions->register( 'periods', 'WordPoints_Hook_Extension_Periods' ); |
|
77 | +function wordpoints_hook_extension_init($extensions) { |
|
78 | + |
|
79 | + $extensions->register('blocker', 'WordPoints_Hook_Extension_Blocker'); |
|
80 | + $extensions->register('repeat_blocker', 'WordPoints_Hook_Extension_Repeat_Blocker'); |
|
81 | + $extensions->register('reversals', 'WordPoints_Hook_Extension_Reversals'); |
|
82 | + $extensions->register('reversals_legacy_points', 'WordPoints_Hook_Extension_Reversals_Legacy_Points'); |
|
83 | + $extensions->register('conditions', 'WordPoints_Hook_Extension_Conditions'); |
|
84 | + $extensions->register('periods', 'WordPoints_Hook_Extension_Periods'); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * |
94 | 94 | * @param WordPoints_Class_Registry_Children $conditions The conditions registry. |
95 | 95 | */ |
96 | -function wordpoints_hook_conditions_init( $conditions ) { |
|
96 | +function wordpoints_hook_conditions_init($conditions) { |
|
97 | 97 | |
98 | 98 | $conditions->register( |
99 | 99 | 'text' |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * |
130 | 130 | * @param WordPoints_Hook_Actions $actions The action registry. |
131 | 131 | */ |
132 | -function wordpoints_hook_actions_init( $actions ) { |
|
132 | +function wordpoints_hook_actions_init($actions) { |
|
133 | 133 | |
134 | 134 | $actions->register( |
135 | 135 | 'comment_approve' |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | , array( |
138 | 138 | 'action' => 'transition_comment_status', |
139 | 139 | 'data' => array( |
140 | - 'arg_index' => array( 'comment' => 2 ), |
|
141 | - 'requirements' => array( 0 => 'approved' ), |
|
140 | + 'arg_index' => array('comment' => 2), |
|
141 | + 'requirements' => array(0 => 'approved'), |
|
142 | 142 | ), |
143 | 143 | ) |
144 | 144 | ); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | , array( |
150 | 150 | 'action' => 'wp_insert_comment', |
151 | 151 | 'data' => array( |
152 | - 'arg_index' => array( 'comment' => 1 ), |
|
152 | + 'arg_index' => array('comment' => 1), |
|
153 | 153 | ), |
154 | 154 | ) |
155 | 155 | ); |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | , array( |
161 | 161 | 'action' => 'transition_comment_status', |
162 | 162 | 'data' => array( |
163 | - 'arg_index' => array( 'comment' => 2 ), |
|
164 | - 'requirements' => array( 1 => 'approved' ), |
|
163 | + 'arg_index' => array('comment' => 2), |
|
164 | + 'requirements' => array(1 => 'approved'), |
|
165 | 165 | ), |
166 | 166 | ) |
167 | 167 | ); |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | , array( |
174 | 174 | 'action' => 'transition_post_status', |
175 | 175 | 'data' => array( |
176 | - 'arg_index' => array( 'post' => 2 ), |
|
177 | - 'requirements' => array( 0 => 'publish' ), |
|
176 | + 'arg_index' => array('post' => 2), |
|
177 | + 'requirements' => array(0 => 'publish'), |
|
178 | 178 | ), |
179 | 179 | ) |
180 | 180 | ); |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | , array( |
186 | 186 | 'action' => 'transition_post_status', |
187 | 187 | 'data' => array( |
188 | - 'arg_index' => array( 'post' => 2 ), |
|
189 | - 'requirements' => array( 1 => 'publish' ), |
|
188 | + 'arg_index' => array('post' => 2), |
|
189 | + 'requirements' => array(1 => 'publish'), |
|
190 | 190 | ), |
191 | 191 | ) |
192 | 192 | ); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | , array( |
198 | 198 | 'action' => 'add_attachment', |
199 | 199 | 'data' => array( |
200 | - 'arg_index' => array( 'post\attachment' => 0 ), |
|
200 | + 'arg_index' => array('post\attachment' => 0), |
|
201 | 201 | ), |
202 | 202 | ) |
203 | 203 | ); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | , array( |
209 | 209 | 'action' => 'delete_post', |
210 | 210 | 'data' => array( |
211 | - 'arg_index' => array( 'post' => 0 ), |
|
211 | + 'arg_index' => array('post' => 0), |
|
212 | 212 | ), |
213 | 213 | ) |
214 | 214 | ); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | , array( |
220 | 220 | 'action' => 'user_register', |
221 | 221 | 'data' => array( |
222 | - 'arg_index' => array( 'user' => 0 ), |
|
222 | + 'arg_index' => array('user' => 0), |
|
223 | 223 | ), |
224 | 224 | ) |
225 | 225 | ); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | , array( |
231 | 231 | 'action' => is_multisite() ? 'wpmu_delete_user' : 'delete_user', |
232 | 232 | 'data' => array( |
233 | - 'arg_index' => array( 'user' => 0 ), |
|
233 | + 'arg_index' => array('user' => 0), |
|
234 | 234 | ), |
235 | 235 | ) |
236 | 236 | ); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * |
254 | 254 | * @param WordPoints_Hook_Events $events The event registry. |
255 | 255 | */ |
256 | -function wordpoints_hook_events_init( $events ) { |
|
256 | +function wordpoints_hook_events_init($events) { |
|
257 | 257 | |
258 | 258 | $events->register( |
259 | 259 | 'user_register' |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | ); |
284 | 284 | |
285 | 285 | // Register events for all of the public post types. |
286 | - $post_types = get_post_types( array( 'public' => true ) ); |
|
286 | + $post_types = get_post_types(array('public' => true)); |
|
287 | 287 | |
288 | 288 | /** |
289 | 289 | * Filter which post types to register hook events for. |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | * |
293 | 293 | * @param string[] The post type slugs ("names"). |
294 | 294 | */ |
295 | - $post_types = apply_filters( 'wordpoints_register_hook_events_for_post_types', $post_types ); |
|
295 | + $post_types = apply_filters('wordpoints_register_hook_events_for_post_types', $post_types); |
|
296 | 296 | |
297 | - foreach ( $post_types as $slug ) { |
|
298 | - wordpoints_register_post_type_hook_events( $slug ); |
|
297 | + foreach ($post_types as $slug) { |
|
298 | + wordpoints_register_post_type_hook_events($slug); |
|
299 | 299 | } |
300 | 300 | } |
301 | 301 | |
@@ -308,10 +308,10 @@ discard block |
||
308 | 308 | * |
309 | 309 | * @param WordPoints_App_Registry $entities The entities app. |
310 | 310 | */ |
311 | -function wordpoints_entities_app_init( $entities ) { |
|
311 | +function wordpoints_entities_app_init($entities) { |
|
312 | 312 | |
313 | - $entities->sub_apps->register( 'children', 'WordPoints_Class_Registry_Children' ); |
|
314 | - $entities->sub_apps->register( 'contexts', 'WordPoints_Class_Registry' ); |
|
313 | + $entities->sub_apps->register('children', 'WordPoints_Class_Registry_Children'); |
|
314 | + $entities->sub_apps->register('contexts', 'WordPoints_Class_Registry'); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
@@ -323,10 +323,10 @@ discard block |
||
323 | 323 | * |
324 | 324 | * @param WordPoints_Class_Registry $contexts The entity context registry. |
325 | 325 | */ |
326 | -function wordpoints_entity_contexts_init( $contexts ) { |
|
326 | +function wordpoints_entity_contexts_init($contexts) { |
|
327 | 327 | |
328 | - $contexts->register( 'network', 'WordPoints_Entity_Context_Network' ); |
|
329 | - $contexts->register( 'site', 'WordPoints_Entity_Context_Site' ); |
|
328 | + $contexts->register('network', 'WordPoints_Entity_Context_Network'); |
|
329 | + $contexts->register('site', 'WordPoints_Entity_Context_Site'); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | /** |
@@ -338,18 +338,18 @@ discard block |
||
338 | 338 | * |
339 | 339 | * @param WordPoints_App_Registry $entities The entities app. |
340 | 340 | */ |
341 | -function wordpoints_entities_init( $entities ) { |
|
341 | +function wordpoints_entities_init($entities) { |
|
342 | 342 | |
343 | 343 | $children = $entities->children; |
344 | 344 | |
345 | - $entities->register( 'user', 'WordPoints_Entity_User' ); |
|
346 | - $children->register( 'user', 'roles', 'WordPoints_Entity_User_Roles' ); |
|
345 | + $entities->register('user', 'WordPoints_Entity_User'); |
|
346 | + $children->register('user', 'roles', 'WordPoints_Entity_User_Roles'); |
|
347 | 347 | |
348 | - $entities->register( 'user_role', 'WordPoints_Entity_User_Role' ); |
|
349 | - $children->register( 'user_role', 'name', 'WordPoints_Entity_User_Role_Name' ); |
|
348 | + $entities->register('user_role', 'WordPoints_Entity_User_Role'); |
|
349 | + $children->register('user_role', 'name', 'WordPoints_Entity_User_Role_Name'); |
|
350 | 350 | |
351 | 351 | // Register entities for all of the public post types. |
352 | - $post_types = get_post_types( array( 'public' => true ) ); |
|
352 | + $post_types = get_post_types(array('public' => true)); |
|
353 | 353 | |
354 | 354 | /** |
355 | 355 | * Filter which post types to register entities for. |
@@ -358,14 +358,14 @@ discard block |
||
358 | 358 | * |
359 | 359 | * @param string[] The post type slugs ("names"). |
360 | 360 | */ |
361 | - $post_types = apply_filters( 'wordpoints_register_entities_for_post_types', $post_types ); |
|
361 | + $post_types = apply_filters('wordpoints_register_entities_for_post_types', $post_types); |
|
362 | 362 | |
363 | - foreach ( $post_types as $slug ) { |
|
364 | - wordpoints_register_post_type_entities( $slug ); |
|
363 | + foreach ($post_types as $slug) { |
|
364 | + wordpoints_register_post_type_entities($slug); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | // Register entities for all of the public taxonomies. |
368 | - $taxonomies = get_taxonomies( array( 'public' => true ) ); |
|
368 | + $taxonomies = get_taxonomies(array('public' => true)); |
|
369 | 369 | |
370 | 370 | /** |
371 | 371 | * Filter which taxonomies to register entities for. |
@@ -374,10 +374,10 @@ discard block |
||
374 | 374 | * |
375 | 375 | * @param string[] The taxonomy slugs. |
376 | 376 | */ |
377 | - $taxonomies = apply_filters( 'wordpoints_register_entities_for_taxonomies', $taxonomies ); |
|
377 | + $taxonomies = apply_filters('wordpoints_register_entities_for_taxonomies', $taxonomies); |
|
378 | 378 | |
379 | - foreach ( $taxonomies as $slug ) { |
|
380 | - wordpoints_register_taxonomy_entities( $slug ); |
|
379 | + foreach ($taxonomies as $slug) { |
|
380 | + wordpoints_register_taxonomy_entities($slug); |
|
381 | 381 | } |
382 | 382 | } |
383 | 383 | |
@@ -388,28 +388,28 @@ discard block |
||
388 | 388 | * |
389 | 389 | * @param string $slug The slug of the post type. |
390 | 390 | */ |
391 | -function wordpoints_register_post_type_entities( $slug ) { |
|
391 | +function wordpoints_register_post_type_entities($slug) { |
|
392 | 392 | |
393 | 393 | $entities = wordpoints_entities(); |
394 | 394 | $children = $entities->children; |
395 | 395 | |
396 | - $entities->register( "post\\{$slug}", 'WordPoints_Entity_Post' ); |
|
397 | - $children->register( "post\\{$slug}", 'author', 'WordPoints_Entity_Post_Author' ); |
|
396 | + $entities->register("post\\{$slug}", 'WordPoints_Entity_Post'); |
|
397 | + $children->register("post\\{$slug}", 'author', 'WordPoints_Entity_Post_Author'); |
|
398 | 398 | |
399 | - $supports = get_all_post_type_supports( $slug ); |
|
399 | + $supports = get_all_post_type_supports($slug); |
|
400 | 400 | |
401 | - if ( isset( $supports['editor'] ) ) { |
|
402 | - $children->register( "post\\{$slug}", 'content', 'WordPoints_Entity_Post_Content' ); |
|
401 | + if (isset($supports['editor'])) { |
|
402 | + $children->register("post\\{$slug}", 'content', 'WordPoints_Entity_Post_Content'); |
|
403 | 403 | } |
404 | 404 | |
405 | - if ( isset( $supports['comments'] ) ) { |
|
406 | - $entities->register( "comment\\{$slug}", 'WordPoints_Entity_Comment' ); |
|
407 | - $children->register( "comment\\{$slug}", "post\\{$slug}", 'WordPoints_Entity_Comment_Post' ); |
|
408 | - $children->register( "comment\\{$slug}", 'author', 'WordPoints_Entity_Comment_Author' ); |
|
405 | + if (isset($supports['comments'])) { |
|
406 | + $entities->register("comment\\{$slug}", 'WordPoints_Entity_Comment'); |
|
407 | + $children->register("comment\\{$slug}", "post\\{$slug}", 'WordPoints_Entity_Comment_Post'); |
|
408 | + $children->register("comment\\{$slug}", 'author', 'WordPoints_Entity_Comment_Author'); |
|
409 | 409 | } |
410 | 410 | |
411 | - foreach ( get_object_taxonomies( $slug ) as $taxonomy_slug ) { |
|
412 | - $children->register( "post\\{$slug}", "terms\\{$taxonomy_slug}", 'WordPoints_Entity_Post_Terms' ); |
|
411 | + foreach (get_object_taxonomies($slug) as $taxonomy_slug) { |
|
412 | + $children->register("post\\{$slug}", "terms\\{$taxonomy_slug}", 'WordPoints_Entity_Post_Terms'); |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | /** |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | * |
420 | 420 | * @param string $slug The slug ("name") of the post type. |
421 | 421 | */ |
422 | - do_action( 'wordpoints_register_post_type_entities', $slug ); |
|
422 | + do_action('wordpoints_register_post_type_entities', $slug); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | /** |
@@ -429,11 +429,11 @@ discard block |
||
429 | 429 | * |
430 | 430 | * @param string $slug The slug of the post type. |
431 | 431 | */ |
432 | -function wordpoints_register_post_type_hook_events( $slug ) { |
|
432 | +function wordpoints_register_post_type_hook_events($slug) { |
|
433 | 433 | |
434 | 434 | $events = wordpoints_hooks()->events; |
435 | 435 | |
436 | - if ( 'attachment' === $slug ) { |
|
436 | + if ('attachment' === $slug) { |
|
437 | 437 | |
438 | 438 | $events->register( |
439 | 439 | 'media_upload' |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | , array( |
458 | 458 | 'actions' => array( |
459 | 459 | 'toggle_on' => 'post_publish', |
460 | - 'toggle_off' => array( 'post_depublish', 'post_delete' ), |
|
460 | + 'toggle_off' => array('post_depublish', 'post_delete'), |
|
461 | 461 | ), |
462 | 462 | 'args' => array( |
463 | 463 | "post\\{$slug}" => 'WordPoints_Hook_Arg_Dynamic', |
@@ -466,14 +466,14 @@ discard block |
||
466 | 466 | ); |
467 | 467 | } |
468 | 468 | |
469 | - if ( post_type_supports( $slug, 'comments' ) ) { |
|
469 | + if (post_type_supports($slug, 'comments')) { |
|
470 | 470 | |
471 | 471 | $events->register( |
472 | 472 | "comment_leave\\{$slug}" |
473 | 473 | , 'WordPoints_Hook_Event_Comment_Leave' |
474 | 474 | , array( |
475 | 475 | 'actions' => array( |
476 | - 'toggle_on' => array( 'comment_approve', 'comment_new' ), |
|
476 | + 'toggle_on' => array('comment_approve', 'comment_new'), |
|
477 | 477 | 'toggle_off' => 'comment_deapprove', |
478 | 478 | ), |
479 | 479 | 'args' => array( |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | * |
491 | 491 | * @param string $slug The slug ("name") of the post type. |
492 | 492 | */ |
493 | - do_action( 'wordpoints_register_post_type_hook_events', $slug ); |
|
493 | + do_action('wordpoints_register_post_type_hook_events', $slug); |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | /** |
@@ -500,13 +500,13 @@ discard block |
||
500 | 500 | * |
501 | 501 | * @param string $slug The slug of the taxonomy. |
502 | 502 | */ |
503 | -function wordpoints_register_taxonomy_entities( $slug ) { |
|
503 | +function wordpoints_register_taxonomy_entities($slug) { |
|
504 | 504 | |
505 | 505 | $entities = wordpoints_entities(); |
506 | 506 | $children = $entities->children; |
507 | 507 | |
508 | - $entities->register( "term\\{$slug}", 'WordPoints_Entity_Term' ); |
|
509 | - $children->register( "term\\{$slug}", 'id', 'WordPoints_Entity_Term_Id' ); |
|
508 | + $entities->register("term\\{$slug}", 'WordPoints_Entity_Term'); |
|
509 | + $children->register("term\\{$slug}", 'id', 'WordPoints_Entity_Term_Id'); |
|
510 | 510 | |
511 | 511 | /** |
512 | 512 | * Fired when registering the entities for a taxonomy. |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | * |
516 | 516 | * @param string $slug The taxonomy's slug. |
517 | 517 | */ |
518 | - do_action( 'wordpoints_register_taxonomy_entities', $slug ); |
|
518 | + do_action('wordpoints_register_taxonomy_entities', $slug); |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | /** |
@@ -527,10 +527,10 @@ discard block |
||
527 | 527 | * |
528 | 528 | * @param WordPoints_Class_RegistryI $data_types The data types registry. |
529 | 529 | */ |
530 | -function wordpoints_data_types_init( $data_types ) { |
|
530 | +function wordpoints_data_types_init($data_types) { |
|
531 | 531 | |
532 | - $data_types->register( 'integer', 'WordPoints_Data_Type_Integer' ); |
|
533 | - $data_types->register( 'text', 'WordPoints_Data_Type_Text' ); |
|
532 | + $data_types->register('integer', 'WordPoints_Data_Type_Integer'); |
|
533 | + $data_types->register('text', 'WordPoints_Data_Type_Text'); |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | /** |
@@ -545,9 +545,9 @@ discard block |
||
545 | 545 | * |
546 | 546 | * @return bool Whether the user can view the points log. |
547 | 547 | */ |
548 | -function wordpoints_hooks_user_can_view_points_log( $can_view, $log ) { |
|
548 | +function wordpoints_hooks_user_can_view_points_log($can_view, $log) { |
|
549 | 549 | |
550 | - if ( ! $can_view ) { |
|
550 | + if ( ! $can_view) { |
|
551 | 551 | return $can_view; |
552 | 552 | } |
553 | 553 | |
@@ -556,11 +556,11 @@ discard block |
||
556 | 556 | $event_slug = $log->log_type; |
557 | 557 | |
558 | 558 | /** @var WordPoints_Hook_Arg $arg */ |
559 | - foreach ( wordpoints_hooks()->events->args->get_children( $event_slug ) as $slug => $arg ) { |
|
559 | + foreach (wordpoints_hooks()->events->args->get_children($event_slug) as $slug => $arg) { |
|
560 | 560 | |
561 | - $value = wordpoints_get_points_log_meta( $log->id, $slug, true ); |
|
561 | + $value = wordpoints_get_points_log_meta($log->id, $slug, true); |
|
562 | 562 | |
563 | - if ( ! $value ) { |
|
563 | + if ( ! $value) { |
|
564 | 564 | continue; |
565 | 565 | } |
566 | 566 | |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | , $value |
571 | 571 | ); |
572 | 572 | |
573 | - if ( ! $can_view ) { |
|
573 | + if ( ! $can_view) { |
|
574 | 574 | break; |
575 | 575 | } |
576 | 576 | } |
@@ -589,20 +589,20 @@ discard block |
||
589 | 589 | * |
590 | 590 | * @return bool Whether the user can view this entity. |
591 | 591 | */ |
592 | -function wordpoints_entity_user_can_view( $user_id, $entity_slug, $entity_id ) { |
|
592 | +function wordpoints_entity_user_can_view($user_id, $entity_slug, $entity_id) { |
|
593 | 593 | |
594 | - $entity = wordpoints_entities()->get( $entity_slug ); |
|
594 | + $entity = wordpoints_entities()->get($entity_slug); |
|
595 | 595 | |
596 | 596 | // If this entity type is not found, we have no way of determining whether it is |
597 | 597 | // safe for the user to view it. |
598 | - if ( ! ( $entity instanceof WordPoints_Entity ) ) { |
|
598 | + if ( ! ($entity instanceof WordPoints_Entity)) { |
|
599 | 599 | return false; |
600 | 600 | } |
601 | 601 | |
602 | 602 | $can_view = true; |
603 | 603 | |
604 | - if ( $entity instanceof WordPoints_Entity_Restricted_VisibilityI ) { |
|
605 | - $can_view = $entity->user_can_view( $user_id, $entity_id ); |
|
604 | + if ($entity instanceof WordPoints_Entity_Restricted_VisibilityI) { |
|
605 | + $can_view = $entity->user_can_view($user_id, $entity_id); |
|
606 | 606 | } |
607 | 607 | |
608 | 608 | /** |
@@ -633,8 +633,8 @@ discard block |
||
633 | 633 | */ |
634 | 634 | function wordpoints_apps() { |
635 | 635 | |
636 | - if ( ! isset( WordPoints_App::$main ) ) { |
|
637 | - WordPoints_App::$main = new WordPoints_App( 'apps' ); |
|
636 | + if ( ! isset(WordPoints_App::$main)) { |
|
637 | + WordPoints_App::$main = new WordPoints_App('apps'); |
|
638 | 638 | } |
639 | 639 | |
640 | 640 | return WordPoints_App::$main; |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | */ |
650 | 650 | function wordpoints_hooks() { |
651 | 651 | |
652 | - if ( ! isset( WordPoints_App::$main ) ) { |
|
652 | + if ( ! isset(WordPoints_App::$main)) { |
|
653 | 653 | wordpoints_apps(); |
654 | 654 | } |
655 | 655 | |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | */ |
666 | 666 | function wordpoints_entities() { |
667 | 667 | |
668 | - if ( ! isset( WordPoints_App::$main ) ) { |
|
668 | + if ( ! isset(WordPoints_App::$main)) { |
|
669 | 669 | wordpoints_apps(); |
670 | 670 | } |
671 | 671 | |
@@ -681,13 +681,13 @@ discard block |
||
681 | 681 | * |
682 | 682 | * @param WordPoints_App $app The main apps app. |
683 | 683 | */ |
684 | -function wordpoints_apps_init( $app ) { |
|
684 | +function wordpoints_apps_init($app) { |
|
685 | 685 | |
686 | 686 | $apps = $app->sub_apps; |
687 | 687 | |
688 | - $apps->register( 'hooks', 'WordPoints_Hooks' ); |
|
689 | - $apps->register( 'entities', 'WordPoints_App_Registry' ); |
|
690 | - $apps->register( 'data_types', 'WordPoints_Class_Registry' ); |
|
688 | + $apps->register('hooks', 'WordPoints_Hooks'); |
|
689 | + $apps->register('entities', 'WordPoints_App_Registry'); |
|
690 | + $apps->register('data_types', 'WordPoints_Class_Registry'); |
|
691 | 691 | } |
692 | 692 | |
693 | 693 | /** |
@@ -700,19 +700,19 @@ discard block |
||
700 | 700 | * |
701 | 701 | * @return object|false The constructed object, or false if to many args were passed. |
702 | 702 | */ |
703 | -function wordpoints_construct_class_with_args( $class_name, array $args ) { |
|
703 | +function wordpoints_construct_class_with_args($class_name, array $args) { |
|
704 | 704 | |
705 | - switch ( count( $args ) ) { |
|
705 | + switch (count($args)) { |
|
706 | 706 | case 0: |
707 | 707 | return new $class_name(); |
708 | 708 | case 1: |
709 | - return new $class_name( $args[0] ); |
|
709 | + return new $class_name($args[0]); |
|
710 | 710 | case 2: |
711 | - return new $class_name( $args[0], $args[1] ); |
|
711 | + return new $class_name($args[0], $args[1]); |
|
712 | 712 | case 3: |
713 | - return new $class_name( $args[0], $args[1], $args[2] ); |
|
713 | + return new $class_name($args[0], $args[1], $args[2]); |
|
714 | 714 | case 4: |
715 | - return new $class_name( $args[0], $args[1], $args[2], $args[3] ); |
|
715 | + return new $class_name($args[0], $args[1], $args[2], $args[3]); |
|
716 | 716 | default: |
717 | 717 | return false; |
718 | 718 | } |
@@ -734,13 +734,13 @@ discard block |
||
734 | 734 | * @return array The slug parsed into the 'generic' and 'dynamic' portions. If the |
735 | 735 | * slug is not dynamic, the value of each of those keys will be false. |
736 | 736 | */ |
737 | -function wordpoints_parse_dynamic_slug( $slug ) { |
|
737 | +function wordpoints_parse_dynamic_slug($slug) { |
|
738 | 738 | |
739 | - $parsed = array( 'dynamic' => false, 'generic' => false ); |
|
739 | + $parsed = array('dynamic' => false, 'generic' => false); |
|
740 | 740 | |
741 | - $parts = explode( '\\', $slug, 2 ); |
|
741 | + $parts = explode('\\', $slug, 2); |
|
742 | 742 | |
743 | - if ( isset( $parts[1] ) ) { |
|
743 | + if (isset($parts[1])) { |
|
744 | 744 | $parsed['dynamic'] = $parts[1]; |
745 | 745 | $parsed['generic'] = $parts[0]; |
746 | 746 | } |
@@ -779,28 +779,28 @@ discard block |
||
779 | 779 | * contexts, indexed by context slug, or false if any of the |
780 | 780 | * contexts isn't current. |
781 | 781 | */ |
782 | -function wordpoints_entities_get_current_context_id( $slug ) { |
|
782 | +function wordpoints_entities_get_current_context_id($slug) { |
|
783 | 783 | |
784 | 784 | $current_context = array(); |
785 | 785 | |
786 | 786 | /** @var WordPoints_Class_Registry $contexts */ |
787 | 787 | $contexts = wordpoints_entities()->contexts; |
788 | 788 | |
789 | - while ( $slug ) { |
|
789 | + while ($slug) { |
|
790 | 790 | |
791 | - $context = $contexts->get( $slug ); |
|
791 | + $context = $contexts->get($slug); |
|
792 | 792 | |
793 | - if ( ! $context instanceof WordPoints_Entity_Context ) { |
|
793 | + if ( ! $context instanceof WordPoints_Entity_Context) { |
|
794 | 794 | return false; |
795 | 795 | } |
796 | 796 | |
797 | 797 | $id = $context->get_current_id(); |
798 | 798 | |
799 | - if ( false === $id ) { |
|
799 | + if (false === $id) { |
|
800 | 800 | return false; |
801 | 801 | } |
802 | 802 | |
803 | - $current_context[ $slug ] = $id; |
|
803 | + $current_context[$slug] = $id; |
|
804 | 804 | |
805 | 805 | $slug = $context->get_parent_slug(); |
806 | 806 | } |
@@ -821,22 +821,22 @@ discard block |
||
821 | 821 | */ |
822 | 822 | function wordpoints_is_network_context() { |
823 | 823 | |
824 | - if ( ! is_multisite() ) { |
|
824 | + if ( ! is_multisite()) { |
|
825 | 825 | return false; |
826 | 826 | } |
827 | 827 | |
828 | - if ( is_network_admin() ) { |
|
828 | + if (is_network_admin()) { |
|
829 | 829 | return true; |
830 | 830 | } |
831 | 831 | |
832 | 832 | // See https://core.trac.wordpress.org/ticket/22589 |
833 | 833 | if ( |
834 | - defined( 'DOING_AJAX' ) |
|
834 | + defined('DOING_AJAX') |
|
835 | 835 | && DOING_AJAX |
836 | - && isset( $_SERVER['HTTP_REFERER'] ) |
|
836 | + && isset($_SERVER['HTTP_REFERER']) |
|
837 | 837 | && preg_match( |
838 | - '#^' . preg_quote( network_admin_url(), '#' ) . '#i' |
|
839 | - , esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) |
|
838 | + '#^'.preg_quote(network_admin_url(), '#').'#i' |
|
839 | + , esc_url_raw(wp_unslash($_SERVER['HTTP_REFERER'])) |
|
840 | 840 | ) |
841 | 841 | ) { |
842 | 842 | return true; |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | * |
850 | 850 | * @param bool $in_network_context Whether we are in network context. |
851 | 851 | */ |
852 | - return apply_filters( 'wordpoints_is_network_context', false ); |
|
852 | + return apply_filters('wordpoints_is_network_context', false); |
|
853 | 853 | } |
854 | 854 | |
855 | 855 | /** |
@@ -863,21 +863,21 @@ discard block |
||
863 | 863 | * |
864 | 864 | * @return string The primary arg's GUID, JSON encoded. |
865 | 865 | */ |
866 | -function wordpoints_hooks_get_event_primary_arg_guid_json( WordPoints_Hook_Event_Args $event_args ) { |
|
866 | +function wordpoints_hooks_get_event_primary_arg_guid_json(WordPoints_Hook_Event_Args $event_args) { |
|
867 | 867 | |
868 | 868 | $entity = $event_args->get_primary_arg(); |
869 | 869 | |
870 | - if ( ! $entity ) { |
|
870 | + if ( ! $entity) { |
|
871 | 871 | return ''; |
872 | 872 | } |
873 | 873 | |
874 | 874 | $the_guid = $entity->get_the_guid(); |
875 | 875 | |
876 | - if ( ! $the_guid ) { |
|
876 | + if ( ! $the_guid) { |
|
877 | 877 | return ''; |
878 | 878 | } |
879 | 879 | |
880 | - return wp_json_encode( $the_guid ); |
|
880 | + return wp_json_encode($the_guid); |
|
881 | 881 | } |
882 | 882 | |
883 | 883 | /** |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | */ |
891 | 891 | function wordpoints_hooks_api_add_global_cache_groups() { |
892 | 892 | |
893 | - if ( function_exists( 'wp_cache_add_global_groups' ) ) { |
|
893 | + if (function_exists('wp_cache_add_global_groups')) { |
|
894 | 894 | |
895 | 895 | wp_cache_add_global_groups( |
896 | 896 | array( |
@@ -916,8 +916,8 @@ discard block |
||
916 | 916 | * @return string The escaped identifier. Already quoted, do not place within |
917 | 917 | * backticks. |
918 | 918 | */ |
919 | -function wordpoints_escape_mysql_identifier( $identifier ) { |
|
920 | - return '`' . str_replace( '`', '``', $identifier ) . '`'; |
|
919 | +function wordpoints_escape_mysql_identifier($identifier) { |
|
920 | + return '`'.str_replace('`', '``', $identifier).'`'; |
|
921 | 921 | } |
922 | 922 | |
923 | 923 | // EOF |