@@ -28,7 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @return bool Whether the user can view the entity. |
30 | 30 | */ |
31 | - public function user_can_view( $user_id, $id ); |
|
31 | + public function user_can_view($user_id, $id); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | // EOF |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * @since 1.0.0 |
34 | 34 | */ |
35 | 35 | public function get_title() { |
36 | - return __( 'User', 'wordpoints' ); |
|
36 | + return __('User', 'wordpoints'); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -29,28 +29,28 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * @since 1.0.0 |
31 | 31 | */ |
32 | - protected function get_entity_human_id( $entity ) { |
|
32 | + protected function get_entity_human_id($entity) { |
|
33 | 33 | |
34 | 34 | global $wp_roles; |
35 | 35 | |
36 | - if ( ! isset( $wp_roles ) ) { |
|
36 | + if ( ! isset($wp_roles)) { |
|
37 | 37 | $wp_roles = new WP_Roles(); |
38 | 38 | } |
39 | 39 | |
40 | 40 | $names = $wp_roles->get_names(); |
41 | 41 | |
42 | - if ( ! isset( $names[ $entity->name ] ) ) { |
|
42 | + if ( ! isset($names[$entity->name])) { |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | |
46 | - return translate_user_role( $names[ $entity->name ] ); |
|
46 | + return translate_user_role($names[$entity->name]); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | 50 | * @since 1.0.0 |
51 | 51 | */ |
52 | 52 | public function get_title() { |
53 | - return __( 'Role', 'wordpoints' ); |
|
53 | + return __('Role', 'wordpoints'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | global $wp_roles; |
62 | 62 | |
63 | - if ( ! isset( $wp_roles ) ) { |
|
63 | + if ( ! isset($wp_roles)) { |
|
64 | 64 | $wp_roles = new WP_Roles(); |
65 | 65 | } |
66 | 66 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @since 1.0.0 |
29 | 29 | */ |
30 | 30 | public function get_title() { |
31 | - return __( 'Name', 'wordpoints' ); |
|
31 | + return __('Name', 'wordpoints'); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * @since 1.0.0 |
34 | 34 | */ |
35 | 35 | public function get_title() { |
36 | - return __( 'Roles', 'wordpoints' ); |
|
36 | + return __('Roles', 'wordpoints'); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @param string $slug The slug of the entity/entity-child. |
41 | 41 | */ |
42 | - public function __construct( $slug ) { |
|
42 | + public function __construct($slug) { |
|
43 | 43 | $this->slug = $slug; |
44 | 44 | } |
45 | 45 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * @since 1.0.0 |
62 | 62 | */ |
63 | - public function set_the_value( $value ) { |
|
63 | + public function set_the_value($value) { |
|
64 | 64 | |
65 | 65 | $this->the_value = $value; |
66 | 66 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * |
61 | 61 | * @return bool Whether the value was set successfully. |
62 | 62 | */ |
63 | - public function set_the_value( $value ); |
|
63 | + public function set_the_value($value); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | // EOF |
@@ -66,16 +66,16 @@ discard block |
||
66 | 66 | /** |
67 | 67 | * @since 1.0.0 |
68 | 68 | */ |
69 | - public function __construct( $slug, array $action_args, array $args = array() ) { |
|
69 | + public function __construct($slug, array $action_args, array $args = array()) { |
|
70 | 70 | |
71 | 71 | $this->slug = $slug; |
72 | 72 | $this->args = $action_args; |
73 | 73 | |
74 | - if ( isset( $args['requirements'] ) ) { |
|
74 | + if (isset($args['requirements'])) { |
|
75 | 75 | $this->requirements = $args['requirements']; |
76 | 76 | } |
77 | 77 | |
78 | - if ( isset( $args['arg_index'] ) ) { |
|
78 | + if (isset($args['arg_index'])) { |
|
79 | 79 | $this->arg_index = $args['arg_index']; |
80 | 80 | } |
81 | 81 | } |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function should_fire() { |
94 | 94 | |
95 | - foreach ( $this->requirements as $arg => $value ) { |
|
96 | - if ( ! isset( $this->args[ $arg ] ) || $this->args[ $arg ] !== $value ) { |
|
95 | + foreach ($this->requirements as $arg => $value) { |
|
96 | + if ( ! isset($this->args[$arg]) || $this->args[$arg] !== $value) { |
|
97 | 97 | return false; |
98 | 98 | } |
99 | 99 | } |
@@ -104,19 +104,19 @@ discard block |
||
104 | 104 | /** |
105 | 105 | * @since 1.0.0 |
106 | 106 | */ |
107 | - public function get_arg_value( $arg_slug ) { |
|
107 | + public function get_arg_value($arg_slug) { |
|
108 | 108 | |
109 | - if ( ! isset( $this->arg_index[ $arg_slug ] ) ) { |
|
109 | + if ( ! isset($this->arg_index[$arg_slug])) { |
|
110 | 110 | return null; |
111 | 111 | } |
112 | 112 | |
113 | - $index = $this->arg_index[ $arg_slug ]; |
|
113 | + $index = $this->arg_index[$arg_slug]; |
|
114 | 114 | |
115 | - if ( ! isset( $this->args[ $index ] ) ) { |
|
115 | + if ( ! isset($this->args[$index])) { |
|
116 | 116 | return null; |
117 | 117 | } |
118 | 118 | |
119 | - return $this->args[ $index ]; |
|
119 | + return $this->args[$index]; |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 |
@@ -19,16 +19,16 @@ |
||
19 | 19 | */ |
20 | 20 | public function should_fire() { |
21 | 21 | |
22 | - $post = $this->get_arg_value( 'post' ); |
|
22 | + $post = $this->get_arg_value('post'); |
|
23 | 23 | |
24 | - if ( ! isset( $post->post_type ) ) { |
|
24 | + if ( ! isset($post->post_type)) { |
|
25 | 25 | return false; |
26 | 26 | } |
27 | 27 | |
28 | - $post_type = get_post_type_object( $post->post_type ); |
|
28 | + $post_type = get_post_type_object($post->post_type); |
|
29 | 29 | |
30 | 30 | // Don't fire for non-public post types (revisions, etc.). |
31 | - if ( empty( $post_type->public ) ) { |
|
31 | + if (empty($post_type->public)) { |
|
32 | 32 | return false; |
33 | 33 | } |
34 | 34 |