@@ -33,7 +33,7 @@ |
||
33 | 33 | * @since 1.0.0 |
34 | 34 | */ |
35 | 35 | public function get_title() { |
36 | - return __( 'Author', 'wordpoints' ); |
|
36 | + return __('Author', 'wordpoints'); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @since 1.0.0 |
29 | 29 | */ |
30 | 30 | public function get_title() { |
31 | - return __( 'Content', 'wordpoints' ); |
|
31 | + return __('Content', 'wordpoints'); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @since 1.0.0 |
34 | 34 | */ |
35 | 35 | public function get_title() { |
36 | - return __( 'Content Type', 'wordpoints' ); |
|
36 | + return __('Content Type', 'wordpoints'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @since 1.0.0 |
43 | 43 | */ |
44 | 44 | public static function get_post_types() { |
45 | - return get_post_types( array( 'public' => true ), 'labels' ); |
|
45 | + return get_post_types(array('public' => true), 'labels'); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @since 1.0.0 |
29 | 29 | */ |
30 | 30 | public function get_title() { |
31 | - return _x( 'Name', 'post type', 'wordpoints' ); |
|
31 | + return _x('Name', 'post type', 'wordpoints'); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | * @since 1.0.0 |
35 | 35 | */ |
36 | 36 | public function get_title() { |
37 | - return __( 'Post Type', 'wordpoints' ); |
|
37 | + return __('Post Type', 'wordpoints'); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | * @return array The parsed slug in the 'slug' key and whether it is an array in |
73 | 73 | * the 'is_array' key. |
74 | 74 | */ |
75 | - protected function parse_slug( $slug ) { |
|
75 | + protected function parse_slug($slug) { |
|
76 | 76 | |
77 | 77 | $is_array = false; |
78 | 78 | |
79 | - if ( '{}' === substr( $slug, -2 ) ) { |
|
79 | + if ('{}' === substr($slug, -2)) { |
|
80 | 80 | $is_array = true; |
81 | - $slug = substr( $slug, 0, -2 ); |
|
81 | + $slug = substr($slug, 0, -2); |
|
82 | 82 | } |
83 | 83 | |
84 | - return array( 'slug' => $slug, 'is_array' => $is_array ); |
|
84 | + return array('slug' => $slug, 'is_array' => $is_array); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | * |
94 | 94 | * @return mixed The ID (array of or IDs) of the related entity (or entities). |
95 | 95 | */ |
96 | - protected function get_related_entity_ids( WordPoints_Entity $entity ) { |
|
97 | - return $entity->get_the_attr_value( $this->related_ids_field ); |
|
96 | + protected function get_related_entity_ids(WordPoints_Entity $entity) { |
|
97 | + return $entity->get_the_attr_value($this->related_ids_field); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | // |
@@ -133,22 +133,22 @@ discard block |
||
133 | 133 | * @return WordPoints_Entity_Array|WordPoints_Entity|false An entity or array of |
134 | 134 | * entities, or false. |
135 | 135 | */ |
136 | - public function get_child( $child_slug ) { |
|
136 | + public function get_child($child_slug) { |
|
137 | 137 | |
138 | - if ( $child_slug !== $this->get_related_entity_slug() ) { |
|
138 | + if ($child_slug !== $this->get_related_entity_slug()) { |
|
139 | 139 | return false; |
140 | 140 | } |
141 | 141 | |
142 | - $parsed_slug = $this->parse_slug( $child_slug ); |
|
142 | + $parsed_slug = $this->parse_slug($child_slug); |
|
143 | 143 | |
144 | - if ( $parsed_slug['is_array'] ) { |
|
145 | - $child = new WordPoints_Entity_Array( $parsed_slug['slug'] ); |
|
144 | + if ($parsed_slug['is_array']) { |
|
145 | + $child = new WordPoints_Entity_Array($parsed_slug['slug']); |
|
146 | 146 | } else { |
147 | - $child = wordpoints_entities()->get( $parsed_slug['slug'] ); |
|
147 | + $child = wordpoints_entities()->get($parsed_slug['slug']); |
|
148 | 148 | } |
149 | 149 | |
150 | - if ( isset( $this->the_value ) ) { |
|
151 | - $child->set_the_value( $this->the_value ); |
|
150 | + if (isset($this->the_value)) { |
|
151 | + $child->set_the_value($this->the_value); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | return $child; |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | /** |
158 | 158 | * @since 1.0.0 |
159 | 159 | */ |
160 | - public function set_the_value_from_entity( WordPoints_Entity $entity ) { |
|
160 | + public function set_the_value_from_entity(WordPoints_Entity $entity) { |
|
161 | 161 | |
162 | 162 | $this->the_value = null; |
163 | 163 | |
164 | - $related_ids = $this->get_related_entity_ids( $entity ); |
|
164 | + $related_ids = $this->get_related_entity_ids($entity); |
|
165 | 165 | |
166 | - if ( ! $related_ids ) { |
|
166 | + if ( ! $related_ids) { |
|
167 | 167 | return false; |
168 | 168 | } |
169 | 169 |
@@ -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 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * @since 1.0.0 |
36 | 36 | */ |
37 | 37 | public function get_title() { |
38 | - return __( 'Site', 'wordpoints' ); |
|
38 | + return __('Site', 'wordpoints'); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 |
@@ -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 |