@@ -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 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @param array $action_args The args the action was fired with. |
27 | 27 | * @param array $args Other args. |
28 | 28 | */ |
29 | - public function __construct( $slug, array $action_args, array $args = array() ); |
|
29 | + public function __construct($slug, array $action_args, array $args = array()); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Get the slug of this action. |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return mixed The arg value. |
59 | 59 | */ |
60 | - public function get_arg_value( $arg_slug ); |
|
60 | + public function get_arg_value($arg_slug); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // EOF |
@@ -40,23 +40,23 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @return object|false The action object, or false if not found. |
42 | 42 | */ |
43 | - public function get( $slug, array $action_args = array(), array $args = array() ) { |
|
43 | + public function get($slug, array $action_args = array(), array $args = array()) { |
|
44 | 44 | |
45 | - if ( ! isset( $this->classes[ $slug ] ) ) { |
|
45 | + if ( ! isset($this->classes[$slug])) { |
|
46 | 46 | return false; |
47 | 47 | } |
48 | 48 | |
49 | - return new $this->classes[ $slug ]( $slug, $action_args, $args ); |
|
49 | + return new $this->classes[$slug]($slug, $action_args, $args); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * @since 1.0.0 |
54 | 54 | */ |
55 | - public function register( $slug, $class, array $args = array() ) { |
|
55 | + public function register($slug, $class, array $args = array()) { |
|
56 | 56 | |
57 | - parent::register( $slug, $class, $args ); |
|
57 | + parent::register($slug, $class, $args); |
|
58 | 58 | |
59 | - $this->router->add_action( $slug, $args ); |
|
59 | + $this->router->add_action($slug, $args); |
|
60 | 60 | |
61 | 61 | return true; |
62 | 62 | } |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | /** |
65 | 65 | * @since 1.0.0 |
66 | 66 | */ |
67 | - public function deregister( $slug ) { |
|
67 | + public function deregister($slug) { |
|
68 | 68 | |
69 | - parent::deregister( $slug ); |
|
69 | + parent::deregister($slug); |
|
70 | 70 | |
71 | - $this->router->remove_action( $slug ); |
|
71 | + $this->router->remove_action($slug); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @since 1.0.0 |
19 | 19 | */ |
20 | 20 | public function get_title() { |
21 | - return __( 'Current Post', 'wordpoints' ); // TODO better title? |
|
21 | + return __('Current Post', 'wordpoints'); // TODO better title? |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function get_value() { |
28 | 28 | |
29 | - if ( ! is_main_query() ) { |
|
29 | + if ( ! is_main_query()) { |
|
30 | 30 | return false; |
31 | 31 | } |
32 | 32 | |
33 | 33 | $object = get_queried_object(); |
34 | 34 | |
35 | - if ( $object instanceof WP_Post ) { |
|
35 | + if ($object instanceof WP_Post) { |
|
36 | 36 | return $object; |
37 | 37 | } else { |
38 | 38 | return false; |