@@ -18,210 +18,210 @@ |
||
18 | 18 | */ |
19 | 19 | class Wordlift_Storage_Factory { |
20 | 20 | |
21 | - /** |
|
22 | - * The {@link Wordlift_Entity_Service} instance. |
|
23 | - * |
|
24 | - * @since 3.15.0 |
|
25 | - * @access private |
|
26 | - * @var \Wordlift_Entity_Service $entity_service The {@link Wordlift_Entity_Service} instance. |
|
27 | - */ |
|
28 | - private $entity_service; |
|
29 | - |
|
30 | - /** |
|
31 | - * The {@link Wordlift_User_Service} instance. |
|
32 | - * |
|
33 | - * @since 3.15.0 |
|
34 | - * @access private |
|
35 | - * @var \Wordlift_User_Service $user_service The {@link Wordlift_User_Service} instance. |
|
36 | - */ |
|
37 | - private $user_service; |
|
38 | - |
|
39 | - /** |
|
40 | - * The {@link Wordlift_Property_Getter} instance. |
|
41 | - * |
|
42 | - * @since 3.15.0 |
|
43 | - * @access private |
|
44 | - * @var \Wordlift_Property_Getter The {@link Wordlift_Property_Getter} instance. |
|
45 | - */ |
|
46 | - private $property_getter; |
|
47 | - |
|
48 | - /** |
|
49 | - * The singleton instance. |
|
50 | - * |
|
51 | - * @since 3.15.0 |
|
52 | - * @access private |
|
53 | - * @var \Wordlift_Storage_Factory $instance The singleton instance. |
|
54 | - */ |
|
55 | - private static $instance; |
|
56 | - |
|
57 | - /** |
|
58 | - * Create a {@link Wordlift_Storage_Factory} instance. |
|
59 | - * |
|
60 | - * @since 3.15.0 |
|
61 | - * |
|
62 | - * @param \Wordlift_Entity_Service $entity_service The {@link Wordlift_Entity_Service} instance. |
|
63 | - * @param \Wordlift_User_Service $user_service The {@link Wordlift_User_Service} instance. |
|
64 | - * @param \Wordlift_Property_Getter $property_getter The {@link Wordlift_Property_Getter} instance. |
|
65 | - */ |
|
66 | - public function __construct( $entity_service, $user_service, $property_getter ) { |
|
67 | - |
|
68 | - $this->entity_service = $entity_service; |
|
69 | - $this->user_service = $user_service; |
|
70 | - $this->property_getter = $property_getter; |
|
71 | - |
|
72 | - self::$instance = $this; |
|
73 | - } |
|
74 | - |
|
75 | - /** |
|
76 | - * Get the singleton instance. |
|
77 | - * |
|
78 | - * @since 3.15.0 |
|
79 | - * |
|
80 | - * @return \Wordlift_Storage_Factory The singleton instance. |
|
81 | - */ |
|
82 | - public static function get_instance() { |
|
83 | - |
|
84 | - return self::$instance; |
|
85 | - } |
|
86 | - |
|
87 | - /** |
|
88 | - * Get a {@link Wordlift_Post_Property_Storage} to read {@link WP_Post}s' |
|
89 | - * titles. |
|
90 | - * |
|
91 | - * @since 3.15.0 |
|
92 | - * |
|
93 | - * @return \Wordlift_Post_Property_Storage A {@link Wordlift_Post_Property_Storage} |
|
94 | - * instance. |
|
95 | - */ |
|
96 | - public function post_title() { |
|
97 | - |
|
98 | - return new Wordlift_Post_Property_Storage( Wordlift_Post_Property_Storage::TITLE ); |
|
99 | - } |
|
100 | - |
|
101 | - /** |
|
102 | - * Get a {@link Wordlift_Post_Property_Storage} to read {@link WP_Post}s' |
|
103 | - * descriptions stripped of tags and shortcodes. |
|
104 | - * |
|
105 | - * @since 3.15.0 |
|
106 | - * |
|
107 | - * @return \Wordlift_Post_Property_Storage A {@link Wordlift_Post_Property_Storage} |
|
108 | - * instance. |
|
109 | - */ |
|
110 | - public function post_description_no_tags_no_shortcodes() { |
|
111 | - |
|
112 | - return new Wordlift_Post_Property_Storage( Wordlift_Post_Property_Storage::DESCRIPTION_NO_TAGS_NO_SHORTCODES ); |
|
113 | - } |
|
114 | - |
|
115 | - /** |
|
116 | - * Get a {@link Wordlift_Post_Property_Storage} to read {@link WP_Post}s' |
|
117 | - * authors. |
|
118 | - * |
|
119 | - * @since 3.15.0 |
|
120 | - * |
|
121 | - * @return \Wordlift_Post_Property_Storage A {@link Wordlift_Post_Property_Storage} |
|
122 | - * instance. |
|
123 | - */ |
|
124 | - public function post_author() { |
|
125 | - |
|
126 | - return new Wordlift_Post_Property_Storage( Wordlift_Post_Property_Storage::AUTHOR ); |
|
127 | - } |
|
128 | - |
|
129 | - /** |
|
130 | - * Get a {@link Wordlift_Post_Property_Storage} to read {@link WP_Post}s' |
|
131 | - * metas. |
|
132 | - * |
|
133 | - * @since 3.15.0 |
|
134 | - * |
|
135 | - * @param string $meta_key The meta key to read. |
|
136 | - * |
|
137 | - * @return Wordlift_Post_Meta_Storage A {@link Wordlift_Post_Meta_Storage} |
|
138 | - * instance. |
|
139 | - */ |
|
140 | - public function post_meta( $meta_key ) { |
|
141 | - |
|
142 | - return new Wordlift_Post_Meta_Storage( $meta_key ); |
|
143 | - } |
|
144 | - |
|
145 | - /** |
|
146 | - * Get a {@link Wordlift_Post_Schema_Class_Storage} to read {@link WP_Post}s' |
|
147 | - * entity type class. |
|
148 | - * |
|
149 | - * @since 3.15.0 |
|
150 | - * |
|
151 | - * @return Wordlift_Post_Schema_Class_Storage A {@link Wordlift_Post_Schema_Class_Storage} |
|
152 | - * instance. |
|
153 | - */ |
|
154 | - public function schema_class() { |
|
155 | - |
|
156 | - return new Wordlift_Post_Schema_Class_Storage(); |
|
157 | - } |
|
158 | - |
|
159 | - /** |
|
160 | - * Get a {@link Wordlift_Post_Author_Storage} instance able to turn an author |
|
161 | - * id into a URI. |
|
162 | - * |
|
163 | - * @since 3.15.0 |
|
164 | - * |
|
165 | - * @return \Wordlift_Post_Author_Storage A {@link Wordlift_Post_Author_Storage} |
|
166 | - * instance. |
|
167 | - */ |
|
168 | - public function author_uri() { |
|
169 | - |
|
170 | - return new Wordlift_Post_Author_Storage( $this->entity_service, $this->user_service ); |
|
171 | - } |
|
172 | - |
|
173 | - /** |
|
174 | - * Get a {@link Wordlift_Post_Meta_Uri_Storage} instance which reads {@link WP_Post} |
|
175 | - * ids and maps them to URI. |
|
176 | - * |
|
177 | - * @param string $meta_key The {@link WP_Post}'s meta key. |
|
178 | - * |
|
179 | - * @return \Wordlift_Post_Meta_Uri_Storage A {@link Wordlift_Post_Meta_Uri_Storage} |
|
180 | - * instance. |
|
181 | - */ |
|
182 | - public function post_meta_to_uri( $meta_key ) { |
|
183 | - |
|
184 | - return new Wordlift_Post_Meta_Uri_Storage( $meta_key, $this->entity_service ); |
|
185 | - } |
|
186 | - |
|
187 | - /** |
|
188 | - * Get a list of {@link WP_Post}'s images URI. |
|
189 | - * |
|
190 | - * @since 3.15.0 |
|
191 | - * |
|
192 | - * @return \Wordlift_Post_Image_Storage A {@link Wordlift_Post_Image_Storage} |
|
193 | - * instance. |
|
194 | - */ |
|
195 | - public function post_images() { |
|
196 | - |
|
197 | - return new Wordlift_Post_Image_Storage(); |
|
198 | - } |
|
199 | - |
|
200 | - /** |
|
201 | - * Get a {@link Wordlift_Post_Related_Storage} instance to get related |
|
202 | - * {@link WP_Post}s. |
|
203 | - * |
|
204 | - * @since 3.15.0 |
|
205 | - * |
|
206 | - * @return \Wordlift_Post_Related_Storage A {@link Wordlift_Post_Related_Storage} |
|
207 | - * instance. |
|
208 | - */ |
|
209 | - public function relations() { |
|
210 | - |
|
211 | - return new Wordlift_Post_Related_Storage( $this->entity_service ); |
|
212 | - } |
|
213 | - |
|
214 | - /** |
|
215 | - * Get the {@link Wordlift_Url_Property_Storage} instance. |
|
216 | - * |
|
217 | - * @since 3.15.0 |
|
218 | - * |
|
219 | - * @return \Wordlift_Url_Property_Storage The {@link Wordlift_Url_Property_Storage} |
|
220 | - * instance. |
|
221 | - */ |
|
222 | - public function url_property() { |
|
223 | - |
|
224 | - return new Wordlift_Url_Property_Storage( $this->property_getter ); |
|
225 | - } |
|
21 | + /** |
|
22 | + * The {@link Wordlift_Entity_Service} instance. |
|
23 | + * |
|
24 | + * @since 3.15.0 |
|
25 | + * @access private |
|
26 | + * @var \Wordlift_Entity_Service $entity_service The {@link Wordlift_Entity_Service} instance. |
|
27 | + */ |
|
28 | + private $entity_service; |
|
29 | + |
|
30 | + /** |
|
31 | + * The {@link Wordlift_User_Service} instance. |
|
32 | + * |
|
33 | + * @since 3.15.0 |
|
34 | + * @access private |
|
35 | + * @var \Wordlift_User_Service $user_service The {@link Wordlift_User_Service} instance. |
|
36 | + */ |
|
37 | + private $user_service; |
|
38 | + |
|
39 | + /** |
|
40 | + * The {@link Wordlift_Property_Getter} instance. |
|
41 | + * |
|
42 | + * @since 3.15.0 |
|
43 | + * @access private |
|
44 | + * @var \Wordlift_Property_Getter The {@link Wordlift_Property_Getter} instance. |
|
45 | + */ |
|
46 | + private $property_getter; |
|
47 | + |
|
48 | + /** |
|
49 | + * The singleton instance. |
|
50 | + * |
|
51 | + * @since 3.15.0 |
|
52 | + * @access private |
|
53 | + * @var \Wordlift_Storage_Factory $instance The singleton instance. |
|
54 | + */ |
|
55 | + private static $instance; |
|
56 | + |
|
57 | + /** |
|
58 | + * Create a {@link Wordlift_Storage_Factory} instance. |
|
59 | + * |
|
60 | + * @since 3.15.0 |
|
61 | + * |
|
62 | + * @param \Wordlift_Entity_Service $entity_service The {@link Wordlift_Entity_Service} instance. |
|
63 | + * @param \Wordlift_User_Service $user_service The {@link Wordlift_User_Service} instance. |
|
64 | + * @param \Wordlift_Property_Getter $property_getter The {@link Wordlift_Property_Getter} instance. |
|
65 | + */ |
|
66 | + public function __construct( $entity_service, $user_service, $property_getter ) { |
|
67 | + |
|
68 | + $this->entity_service = $entity_service; |
|
69 | + $this->user_service = $user_service; |
|
70 | + $this->property_getter = $property_getter; |
|
71 | + |
|
72 | + self::$instance = $this; |
|
73 | + } |
|
74 | + |
|
75 | + /** |
|
76 | + * Get the singleton instance. |
|
77 | + * |
|
78 | + * @since 3.15.0 |
|
79 | + * |
|
80 | + * @return \Wordlift_Storage_Factory The singleton instance. |
|
81 | + */ |
|
82 | + public static function get_instance() { |
|
83 | + |
|
84 | + return self::$instance; |
|
85 | + } |
|
86 | + |
|
87 | + /** |
|
88 | + * Get a {@link Wordlift_Post_Property_Storage} to read {@link WP_Post}s' |
|
89 | + * titles. |
|
90 | + * |
|
91 | + * @since 3.15.0 |
|
92 | + * |
|
93 | + * @return \Wordlift_Post_Property_Storage A {@link Wordlift_Post_Property_Storage} |
|
94 | + * instance. |
|
95 | + */ |
|
96 | + public function post_title() { |
|
97 | + |
|
98 | + return new Wordlift_Post_Property_Storage( Wordlift_Post_Property_Storage::TITLE ); |
|
99 | + } |
|
100 | + |
|
101 | + /** |
|
102 | + * Get a {@link Wordlift_Post_Property_Storage} to read {@link WP_Post}s' |
|
103 | + * descriptions stripped of tags and shortcodes. |
|
104 | + * |
|
105 | + * @since 3.15.0 |
|
106 | + * |
|
107 | + * @return \Wordlift_Post_Property_Storage A {@link Wordlift_Post_Property_Storage} |
|
108 | + * instance. |
|
109 | + */ |
|
110 | + public function post_description_no_tags_no_shortcodes() { |
|
111 | + |
|
112 | + return new Wordlift_Post_Property_Storage( Wordlift_Post_Property_Storage::DESCRIPTION_NO_TAGS_NO_SHORTCODES ); |
|
113 | + } |
|
114 | + |
|
115 | + /** |
|
116 | + * Get a {@link Wordlift_Post_Property_Storage} to read {@link WP_Post}s' |
|
117 | + * authors. |
|
118 | + * |
|
119 | + * @since 3.15.0 |
|
120 | + * |
|
121 | + * @return \Wordlift_Post_Property_Storage A {@link Wordlift_Post_Property_Storage} |
|
122 | + * instance. |
|
123 | + */ |
|
124 | + public function post_author() { |
|
125 | + |
|
126 | + return new Wordlift_Post_Property_Storage( Wordlift_Post_Property_Storage::AUTHOR ); |
|
127 | + } |
|
128 | + |
|
129 | + /** |
|
130 | + * Get a {@link Wordlift_Post_Property_Storage} to read {@link WP_Post}s' |
|
131 | + * metas. |
|
132 | + * |
|
133 | + * @since 3.15.0 |
|
134 | + * |
|
135 | + * @param string $meta_key The meta key to read. |
|
136 | + * |
|
137 | + * @return Wordlift_Post_Meta_Storage A {@link Wordlift_Post_Meta_Storage} |
|
138 | + * instance. |
|
139 | + */ |
|
140 | + public function post_meta( $meta_key ) { |
|
141 | + |
|
142 | + return new Wordlift_Post_Meta_Storage( $meta_key ); |
|
143 | + } |
|
144 | + |
|
145 | + /** |
|
146 | + * Get a {@link Wordlift_Post_Schema_Class_Storage} to read {@link WP_Post}s' |
|
147 | + * entity type class. |
|
148 | + * |
|
149 | + * @since 3.15.0 |
|
150 | + * |
|
151 | + * @return Wordlift_Post_Schema_Class_Storage A {@link Wordlift_Post_Schema_Class_Storage} |
|
152 | + * instance. |
|
153 | + */ |
|
154 | + public function schema_class() { |
|
155 | + |
|
156 | + return new Wordlift_Post_Schema_Class_Storage(); |
|
157 | + } |
|
158 | + |
|
159 | + /** |
|
160 | + * Get a {@link Wordlift_Post_Author_Storage} instance able to turn an author |
|
161 | + * id into a URI. |
|
162 | + * |
|
163 | + * @since 3.15.0 |
|
164 | + * |
|
165 | + * @return \Wordlift_Post_Author_Storage A {@link Wordlift_Post_Author_Storage} |
|
166 | + * instance. |
|
167 | + */ |
|
168 | + public function author_uri() { |
|
169 | + |
|
170 | + return new Wordlift_Post_Author_Storage( $this->entity_service, $this->user_service ); |
|
171 | + } |
|
172 | + |
|
173 | + /** |
|
174 | + * Get a {@link Wordlift_Post_Meta_Uri_Storage} instance which reads {@link WP_Post} |
|
175 | + * ids and maps them to URI. |
|
176 | + * |
|
177 | + * @param string $meta_key The {@link WP_Post}'s meta key. |
|
178 | + * |
|
179 | + * @return \Wordlift_Post_Meta_Uri_Storage A {@link Wordlift_Post_Meta_Uri_Storage} |
|
180 | + * instance. |
|
181 | + */ |
|
182 | + public function post_meta_to_uri( $meta_key ) { |
|
183 | + |
|
184 | + return new Wordlift_Post_Meta_Uri_Storage( $meta_key, $this->entity_service ); |
|
185 | + } |
|
186 | + |
|
187 | + /** |
|
188 | + * Get a list of {@link WP_Post}'s images URI. |
|
189 | + * |
|
190 | + * @since 3.15.0 |
|
191 | + * |
|
192 | + * @return \Wordlift_Post_Image_Storage A {@link Wordlift_Post_Image_Storage} |
|
193 | + * instance. |
|
194 | + */ |
|
195 | + public function post_images() { |
|
196 | + |
|
197 | + return new Wordlift_Post_Image_Storage(); |
|
198 | + } |
|
199 | + |
|
200 | + /** |
|
201 | + * Get a {@link Wordlift_Post_Related_Storage} instance to get related |
|
202 | + * {@link WP_Post}s. |
|
203 | + * |
|
204 | + * @since 3.15.0 |
|
205 | + * |
|
206 | + * @return \Wordlift_Post_Related_Storage A {@link Wordlift_Post_Related_Storage} |
|
207 | + * instance. |
|
208 | + */ |
|
209 | + public function relations() { |
|
210 | + |
|
211 | + return new Wordlift_Post_Related_Storage( $this->entity_service ); |
|
212 | + } |
|
213 | + |
|
214 | + /** |
|
215 | + * Get the {@link Wordlift_Url_Property_Storage} instance. |
|
216 | + * |
|
217 | + * @since 3.15.0 |
|
218 | + * |
|
219 | + * @return \Wordlift_Url_Property_Storage The {@link Wordlift_Url_Property_Storage} |
|
220 | + * instance. |
|
221 | + */ |
|
222 | + public function url_property() { |
|
223 | + |
|
224 | + return new Wordlift_Url_Property_Storage( $this->property_getter ); |
|
225 | + } |
|
226 | 226 | |
227 | 227 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @param \Wordlift_User_Service $user_service The {@link Wordlift_User_Service} instance. |
64 | 64 | * @param \Wordlift_Property_Getter $property_getter The {@link Wordlift_Property_Getter} instance. |
65 | 65 | */ |
66 | - public function __construct( $entity_service, $user_service, $property_getter ) { |
|
66 | + public function __construct($entity_service, $user_service, $property_getter) { |
|
67 | 67 | |
68 | 68 | $this->entity_service = $entity_service; |
69 | 69 | $this->user_service = $user_service; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function post_title() { |
97 | 97 | |
98 | - return new Wordlift_Post_Property_Storage( Wordlift_Post_Property_Storage::TITLE ); |
|
98 | + return new Wordlift_Post_Property_Storage(Wordlift_Post_Property_Storage::TITLE); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function post_description_no_tags_no_shortcodes() { |
111 | 111 | |
112 | - return new Wordlift_Post_Property_Storage( Wordlift_Post_Property_Storage::DESCRIPTION_NO_TAGS_NO_SHORTCODES ); |
|
112 | + return new Wordlift_Post_Property_Storage(Wordlift_Post_Property_Storage::DESCRIPTION_NO_TAGS_NO_SHORTCODES); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function post_author() { |
125 | 125 | |
126 | - return new Wordlift_Post_Property_Storage( Wordlift_Post_Property_Storage::AUTHOR ); |
|
126 | + return new Wordlift_Post_Property_Storage(Wordlift_Post_Property_Storage::AUTHOR); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | * @return Wordlift_Post_Meta_Storage A {@link Wordlift_Post_Meta_Storage} |
138 | 138 | * instance. |
139 | 139 | */ |
140 | - public function post_meta( $meta_key ) { |
|
140 | + public function post_meta($meta_key) { |
|
141 | 141 | |
142 | - return new Wordlift_Post_Meta_Storage( $meta_key ); |
|
142 | + return new Wordlift_Post_Meta_Storage($meta_key); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public function author_uri() { |
169 | 169 | |
170 | - return new Wordlift_Post_Author_Storage( $this->entity_service, $this->user_service ); |
|
170 | + return new Wordlift_Post_Author_Storage($this->entity_service, $this->user_service); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | * @return \Wordlift_Post_Meta_Uri_Storage A {@link Wordlift_Post_Meta_Uri_Storage} |
180 | 180 | * instance. |
181 | 181 | */ |
182 | - public function post_meta_to_uri( $meta_key ) { |
|
182 | + public function post_meta_to_uri($meta_key) { |
|
183 | 183 | |
184 | - return new Wordlift_Post_Meta_Uri_Storage( $meta_key, $this->entity_service ); |
|
184 | + return new Wordlift_Post_Meta_Uri_Storage($meta_key, $this->entity_service); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | */ |
209 | 209 | public function relations() { |
210 | 210 | |
211 | - return new Wordlift_Post_Related_Storage( $this->entity_service ); |
|
211 | + return new Wordlift_Post_Related_Storage($this->entity_service); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function url_property() { |
223 | 223 | |
224 | - return new Wordlift_Url_Property_Storage( $this->property_getter ); |
|
224 | + return new Wordlift_Url_Property_Storage($this->property_getter); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | } |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <!-- Pane 6 content --> |
2 | 2 | <script type="text/html" id="page-5"> |
3 | 3 | <h2 class="page-title"> |
4 | - <?php esc_html_e( 'Publisher', 'wordlift' ); ?> |
|
4 | + <?php esc_html_e('Publisher', 'wordlift'); ?> |
|
5 | 5 | </h2> |
6 | 6 | |
7 | 7 | <p class="page-txt"> |
8 | - <?php esc_html_e( 'Are you going to publish as an individual or as a company?', 'wordlift' ); ?> |
|
8 | + <?php esc_html_e('Are you going to publish as an individual or as a company?', 'wordlift'); ?> |
|
9 | 9 | </p> |
10 | 10 | |
11 | 11 | <div class="radio-wrapper"> |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | <span class="radio"><span class="check"></span></span> |
21 | 21 | |
22 | 22 | <span class="label"> |
23 | - <?php esc_html_e( 'Personal', 'wordlift' ); ?> |
|
23 | + <?php esc_html_e('Personal', 'wordlift'); ?> |
|
24 | 24 | </span> |
25 | 25 | </label> |
26 | 26 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | <span class="radio"><span class="check"></span></span> |
36 | 36 | |
37 | 37 | <span class="label"> |
38 | - <?php esc_html_e( 'Company', 'wordlift' ); ?> |
|
38 | + <?php esc_html_e('Company', 'wordlift'); ?> |
|
39 | 39 | </span> |
40 | 40 | </label> |
41 | 41 | </div> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | value="" |
48 | 48 | autocomplete="off" |
49 | 49 | class="untouched invalid" |
50 | - placeholder="<?php esc_attr_e( "What's your name?", 'wordlift' ); ?>" |
|
50 | + placeholder="<?php esc_attr_e("What's your name?", 'wordlift'); ?>" |
|
51 | 51 | > |
52 | 52 | |
53 | 53 | <div data-wl-logo="wl-logo"> |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | class="add-logo" |
66 | 66 | href="javascript:void(0);" |
67 | 67 | > |
68 | - <?php esc_html_e( 'Add your logo', 'wordlift' ); ?> |
|
68 | + <?php esc_html_e('Add your logo', 'wordlift'); ?> |
|
69 | 69 | </a> |
70 | 70 | </div> |
71 | 71 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | type="submit" |
75 | 75 | id="btn-finish" |
76 | 76 | class="wl-default-action" |
77 | - value="<?php esc_attr_e( 'Finish', 'wordlift' ); ?>" |
|
77 | + value="<?php esc_attr_e('Finish', 'wordlift'); ?>" |
|
78 | 78 | > |
79 | 79 | </div> |
80 | 80 | </script> |
@@ -18,63 +18,63 @@ |
||
18 | 18 | */ |
19 | 19 | abstract class Wordlift_Install { |
20 | 20 | |
21 | - /** |
|
22 | - * A {@link Wordlift_Log_Service} instance. |
|
23 | - * |
|
24 | - * @since 3.18.0 |
|
25 | - * @access private |
|
26 | - * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance. |
|
27 | - */ |
|
28 | - protected $log; |
|
21 | + /** |
|
22 | + * A {@link Wordlift_Log_Service} instance. |
|
23 | + * |
|
24 | + * @since 3.18.0 |
|
25 | + * @access private |
|
26 | + * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance. |
|
27 | + */ |
|
28 | + protected $log; |
|
29 | 29 | |
30 | - /** |
|
31 | - * The default install version. Overridden by the installation packages. |
|
32 | - * |
|
33 | - * @since 3.18.0 |
|
34 | - * @access protected |
|
35 | - * @var string $version The install version. |
|
36 | - */ |
|
37 | - protected static $version = '0.0.0'; |
|
30 | + /** |
|
31 | + * The default install version. Overridden by the installation packages. |
|
32 | + * |
|
33 | + * @since 3.18.0 |
|
34 | + * @access protected |
|
35 | + * @var string $version The install version. |
|
36 | + */ |
|
37 | + protected static $version = '0.0.0'; |
|
38 | 38 | |
39 | - /** |
|
40 | - * Wordlift_Install_Service constructor. |
|
41 | - * |
|
42 | - * @since 3.18.0 |
|
43 | - */ |
|
44 | - public function __construct() { |
|
39 | + /** |
|
40 | + * Wordlift_Install_Service constructor. |
|
41 | + * |
|
42 | + * @since 3.18.0 |
|
43 | + */ |
|
44 | + public function __construct() { |
|
45 | 45 | |
46 | - $this->log = Wordlift_Log_Service::get_logger( get_class( $this ) ); |
|
46 | + $this->log = Wordlift_Log_Service::get_logger( get_class( $this ) ); |
|
47 | 47 | |
48 | - } |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * Return the current version of the installation. |
|
52 | - * |
|
53 | - * @since 3.18.0 |
|
54 | - */ |
|
55 | - public function get_version() { |
|
56 | - return static::$version; |
|
57 | - } |
|
50 | + /** |
|
51 | + * Return the current version of the installation. |
|
52 | + * |
|
53 | + * @since 3.18.0 |
|
54 | + */ |
|
55 | + public function get_version() { |
|
56 | + return static::$version; |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * Run the install procedure. This function must be implemented by superclasses. |
|
61 | - * |
|
62 | - * @since 3.18.0 |
|
63 | - * |
|
64 | - * @return mixed The result. |
|
65 | - */ |
|
66 | - abstract public function install(); |
|
59 | + /** |
|
60 | + * Run the install procedure. This function must be implemented by superclasses. |
|
61 | + * |
|
62 | + * @since 3.18.0 |
|
63 | + * |
|
64 | + * @return mixed The result. |
|
65 | + */ |
|
66 | + abstract public function install(); |
|
67 | 67 | |
68 | - /** |
|
69 | - * A custom procedure run by the caller to determine whether the install procedure must be run. |
|
70 | - * |
|
71 | - * @since 3.20.0 |
|
72 | - * |
|
73 | - * @return bool True if the procedure must run. |
|
74 | - */ |
|
75 | - public function must_install() { |
|
68 | + /** |
|
69 | + * A custom procedure run by the caller to determine whether the install procedure must be run. |
|
70 | + * |
|
71 | + * @since 3.20.0 |
|
72 | + * |
|
73 | + * @return bool True if the procedure must run. |
|
74 | + */ |
|
75 | + public function must_install() { |
|
76 | 76 | |
77 | - return false; |
|
78 | - } |
|
77 | + return false; |
|
78 | + } |
|
79 | 79 | |
80 | 80 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | |
46 | - $this->log = Wordlift_Log_Service::get_logger( get_class( $this ) ); |
|
46 | + $this->log = Wordlift_Log_Service::get_logger(get_class($this)); |
|
47 | 47 | |
48 | 48 | } |
49 | 49 |
@@ -16,23 +16,23 @@ |
||
16 | 16 | */ |
17 | 17 | class Wordlift_Install_3_19_5 extends Wordlift_Install { |
18 | 18 | |
19 | - /** |
|
20 | - * {@inheritdoc} |
|
21 | - */ |
|
22 | - protected static $version = '3.19.5'; |
|
19 | + /** |
|
20 | + * {@inheritdoc} |
|
21 | + */ |
|
22 | + protected static $version = '3.19.5'; |
|
23 | 23 | |
24 | - /** |
|
25 | - * {@inheritdoc} |
|
26 | - */ |
|
27 | - public function install() { |
|
24 | + /** |
|
25 | + * {@inheritdoc} |
|
26 | + */ |
|
27 | + public function install() { |
|
28 | 28 | |
29 | - /* |
|
29 | + /* |
|
30 | 30 | * Flush all the caches, since we changed some JSON-LD publishing rules. |
31 | 31 | * |
32 | 32 | * @see https://github.com/insideout10/wordlift-plugin/issues/858 |
33 | 33 | */ |
34 | - Wordlift_File_Cache_Service::flush_all(); |
|
34 | + Wordlift_File_Cache_Service::flush_all(); |
|
35 | 35 | |
36 | - } |
|
36 | + } |
|
37 | 37 | |
38 | 38 | } |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | $key = $configuration_service->get_key(); |
37 | 37 | |
38 | 38 | // Bail out if the `key` isn't set. |
39 | - if ( empty( $key ) ) { |
|
39 | + if (empty($key)) { |
|
40 | 40 | return; |
41 | 41 | } |
42 | 42 | |
43 | 43 | // Calling this function will get and set the remote dataset and package type. |
44 | - $configuration_service->get_remote_dataset_uri( $key ); |
|
44 | + $configuration_service->get_remote_dataset_uri($key); |
|
45 | 45 | |
46 | 46 | } |
47 | 47 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $package_type = $configuration_service->get_package_type(); |
61 | 61 | |
62 | 62 | // We need to determine the package type if the `key` is set, but the `package_type` isn't. |
63 | - return is_admin() && ! empty( $key ) && empty( $package_type ); |
|
63 | + return is_admin() && ! empty($key) && empty($package_type); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | } |
@@ -16,51 +16,51 @@ |
||
16 | 16 | */ |
17 | 17 | class Wordlift_Install_Package_Type extends Wordlift_Install { |
18 | 18 | |
19 | - /** |
|
20 | - * The install version. |
|
21 | - * |
|
22 | - * @since 3.20.0 |
|
23 | - */ |
|
24 | - protected static $version = '3.20.0'; |
|
19 | + /** |
|
20 | + * The install version. |
|
21 | + * |
|
22 | + * @since 3.20.0 |
|
23 | + */ |
|
24 | + protected static $version = '3.20.0'; |
|
25 | 25 | |
26 | - /** |
|
27 | - * Run the install procedure. |
|
28 | - * |
|
29 | - * @since 3.20.0 |
|
30 | - * |
|
31 | - * @return mixed The result. |
|
32 | - */ |
|
33 | - public function install() { |
|
26 | + /** |
|
27 | + * Run the install procedure. |
|
28 | + * |
|
29 | + * @since 3.20.0 |
|
30 | + * |
|
31 | + * @return mixed The result. |
|
32 | + */ |
|
33 | + public function install() { |
|
34 | 34 | |
35 | - $configuration_service = Wordlift_Configuration_Service::get_instance(); |
|
36 | - $key = $configuration_service->get_key(); |
|
35 | + $configuration_service = Wordlift_Configuration_Service::get_instance(); |
|
36 | + $key = $configuration_service->get_key(); |
|
37 | 37 | |
38 | - // Bail out if the `key` isn't set. |
|
39 | - if ( empty( $key ) ) { |
|
40 | - return; |
|
41 | - } |
|
38 | + // Bail out if the `key` isn't set. |
|
39 | + if ( empty( $key ) ) { |
|
40 | + return; |
|
41 | + } |
|
42 | 42 | |
43 | - // Calling this function will get and set the remote dataset and package type. |
|
44 | - $configuration_service->get_remote_dataset_uri( $key ); |
|
43 | + // Calling this function will get and set the remote dataset and package type. |
|
44 | + $configuration_service->get_remote_dataset_uri( $key ); |
|
45 | 45 | |
46 | - } |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Must install when the package type isn't set. |
|
50 | - * |
|
51 | - * See https://github.com/insideout10/wordlift-plugin/issues/761 |
|
52 | - * |
|
53 | - * @since 3.20.0 |
|
54 | - * @return bool True if package type is set, otherwise false. |
|
55 | - */ |
|
56 | - public function must_install() { |
|
48 | + /** |
|
49 | + * Must install when the package type isn't set. |
|
50 | + * |
|
51 | + * See https://github.com/insideout10/wordlift-plugin/issues/761 |
|
52 | + * |
|
53 | + * @since 3.20.0 |
|
54 | + * @return bool True if package type is set, otherwise false. |
|
55 | + */ |
|
56 | + public function must_install() { |
|
57 | 57 | |
58 | - $configuration_service = Wordlift_Configuration_Service::get_instance(); |
|
59 | - $key = $configuration_service->get_key(); |
|
60 | - $package_type = $configuration_service->get_package_type(); |
|
58 | + $configuration_service = Wordlift_Configuration_Service::get_instance(); |
|
59 | + $key = $configuration_service->get_key(); |
|
60 | + $package_type = $configuration_service->get_package_type(); |
|
61 | 61 | |
62 | - // We need to determine the package type if the `key` is set, but the `package_type` isn't. |
|
63 | - return is_admin() && ! empty( $key ) && empty( $package_type ); |
|
64 | - } |
|
62 | + // We need to determine the package type if the `key` is set, but the `package_type` isn't. |
|
63 | + return is_admin() && ! empty( $key ) && empty( $package_type ); |
|
64 | + } |
|
65 | 65 | |
66 | 66 | } |
@@ -15,32 +15,32 @@ |
||
15 | 15 | */ |
16 | 16 | interface Wordlift_Batch_Operation_Interface { |
17 | 17 | |
18 | - /** |
|
19 | - * Process the batch operation starting from the specified offset. |
|
20 | - * |
|
21 | - * @since 3.20.0 |
|
22 | - * |
|
23 | - * @param int $offset Start from the specified offset (or 0 if not specified). |
|
24 | - * @param int $limit Process the specified amount of items per call (or 10 if not specified). |
|
25 | - * |
|
26 | - * @return array { |
|
27 | - * The operation result. |
|
28 | - * |
|
29 | - * @type int $next The next offset. |
|
30 | - * @type int $limit The amount of items to process per call. |
|
31 | - * @type int $remaining The remaining number of elements to process. |
|
32 | - * @type bool $complete Whether the operation completed. |
|
33 | - * } |
|
34 | - */ |
|
35 | - public function process( $offset = 0, $limit = 10 ); |
|
18 | + /** |
|
19 | + * Process the batch operation starting from the specified offset. |
|
20 | + * |
|
21 | + * @since 3.20.0 |
|
22 | + * |
|
23 | + * @param int $offset Start from the specified offset (or 0 if not specified). |
|
24 | + * @param int $limit Process the specified amount of items per call (or 10 if not specified). |
|
25 | + * |
|
26 | + * @return array { |
|
27 | + * The operation result. |
|
28 | + * |
|
29 | + * @type int $next The next offset. |
|
30 | + * @type int $limit The amount of items to process per call. |
|
31 | + * @type int $remaining The remaining number of elements to process. |
|
32 | + * @type bool $complete Whether the operation completed. |
|
33 | + * } |
|
34 | + */ |
|
35 | + public function process( $offset = 0, $limit = 10 ); |
|
36 | 36 | |
37 | - /** |
|
38 | - * Count the number of elements that would be affected by the operation. |
|
39 | - * |
|
40 | - * @since 3.20.0 |
|
41 | - * |
|
42 | - * @return int The number of elements that would be affected. |
|
43 | - */ |
|
44 | - public function count(); |
|
37 | + /** |
|
38 | + * Count the number of elements that would be affected by the operation. |
|
39 | + * |
|
40 | + * @since 3.20.0 |
|
41 | + * |
|
42 | + * @return int The number of elements that would be affected. |
|
43 | + */ |
|
44 | + public function count(); |
|
45 | 45 | |
46 | 46 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | * @type bool $complete Whether the operation completed. |
33 | 33 | * } |
34 | 34 | */ |
35 | - public function process( $offset = 0, $limit = 10 ); |
|
35 | + public function process($offset = 0, $limit = 10); |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Count the number of elements that would be affected by the operation. |
@@ -18,75 +18,75 @@ |
||
18 | 18 | */ |
19 | 19 | class Wordlift_Post_Property_Storage extends Wordlift_Storage { |
20 | 20 | |
21 | - /** |
|
22 | - * The `post_title` property. |
|
23 | - */ |
|
24 | - const TITLE = 'title'; |
|
25 | - |
|
26 | - /** |
|
27 | - * The `post_content` property stripped of tags and shortcodes. |
|
28 | - */ |
|
29 | - const DESCRIPTION_NO_TAGS_NO_SHORTCODES = 'description_no_tags_no_shortcodes'; |
|
30 | - |
|
31 | - /** |
|
32 | - * The `post_author` property. |
|
33 | - */ |
|
34 | - const AUTHOR = 'author'; |
|
35 | - |
|
36 | - /** |
|
37 | - * The {@link WP_Post} property to retrieve. |
|
38 | - * |
|
39 | - * @since 3.15.0 |
|
40 | - * @access private |
|
41 | - * @var string $property The {@link WP_Post} property to retrieve. |
|
42 | - */ |
|
43 | - private $property; |
|
44 | - |
|
45 | - /** |
|
46 | - * Create a {@link Wordlift_Post_Property_Storage} instance. |
|
47 | - * |
|
48 | - * @since 3.15.0 |
|
49 | - * |
|
50 | - * @param string $property A post property. |
|
51 | - */ |
|
52 | - public function __construct( $property ) { |
|
53 | - |
|
54 | - $this->property = $property; |
|
55 | - |
|
56 | - } |
|
57 | - |
|
58 | - /** |
|
59 | - * Get the property value. |
|
60 | - * |
|
61 | - * @since 3.15.0 |
|
62 | - * |
|
63 | - * @param int $post_id The {@link WP_Post}'s id. |
|
64 | - * |
|
65 | - * @return array|string|null A single string, or an array of values or null |
|
66 | - * if the property isn't recognized. |
|
67 | - */ |
|
68 | - public function get( $post_id ) { |
|
69 | - |
|
70 | - // Get the post. |
|
71 | - $post = get_post( $post_id ); |
|
72 | - |
|
73 | - // Switch according to the selected property. |
|
74 | - switch ( $this->property ) { |
|
75 | - |
|
76 | - // Title. |
|
77 | - case self::TITLE: |
|
78 | - return $post->post_title; |
|
79 | - |
|
80 | - // Description. |
|
81 | - case self::DESCRIPTION_NO_TAGS_NO_SHORTCODES: |
|
82 | - return wp_strip_all_tags( preg_replace( '/\[[^]]+\]/', '', do_shortcode( $post->post_content ) ) ); |
|
83 | - |
|
84 | - // Author. |
|
85 | - case self::AUTHOR: |
|
86 | - return $post->post_author; |
|
87 | - } |
|
88 | - |
|
89 | - return null; |
|
90 | - } |
|
21 | + /** |
|
22 | + * The `post_title` property. |
|
23 | + */ |
|
24 | + const TITLE = 'title'; |
|
25 | + |
|
26 | + /** |
|
27 | + * The `post_content` property stripped of tags and shortcodes. |
|
28 | + */ |
|
29 | + const DESCRIPTION_NO_TAGS_NO_SHORTCODES = 'description_no_tags_no_shortcodes'; |
|
30 | + |
|
31 | + /** |
|
32 | + * The `post_author` property. |
|
33 | + */ |
|
34 | + const AUTHOR = 'author'; |
|
35 | + |
|
36 | + /** |
|
37 | + * The {@link WP_Post} property to retrieve. |
|
38 | + * |
|
39 | + * @since 3.15.0 |
|
40 | + * @access private |
|
41 | + * @var string $property The {@link WP_Post} property to retrieve. |
|
42 | + */ |
|
43 | + private $property; |
|
44 | + |
|
45 | + /** |
|
46 | + * Create a {@link Wordlift_Post_Property_Storage} instance. |
|
47 | + * |
|
48 | + * @since 3.15.0 |
|
49 | + * |
|
50 | + * @param string $property A post property. |
|
51 | + */ |
|
52 | + public function __construct( $property ) { |
|
53 | + |
|
54 | + $this->property = $property; |
|
55 | + |
|
56 | + } |
|
57 | + |
|
58 | + /** |
|
59 | + * Get the property value. |
|
60 | + * |
|
61 | + * @since 3.15.0 |
|
62 | + * |
|
63 | + * @param int $post_id The {@link WP_Post}'s id. |
|
64 | + * |
|
65 | + * @return array|string|null A single string, or an array of values or null |
|
66 | + * if the property isn't recognized. |
|
67 | + */ |
|
68 | + public function get( $post_id ) { |
|
69 | + |
|
70 | + // Get the post. |
|
71 | + $post = get_post( $post_id ); |
|
72 | + |
|
73 | + // Switch according to the selected property. |
|
74 | + switch ( $this->property ) { |
|
75 | + |
|
76 | + // Title. |
|
77 | + case self::TITLE: |
|
78 | + return $post->post_title; |
|
79 | + |
|
80 | + // Description. |
|
81 | + case self::DESCRIPTION_NO_TAGS_NO_SHORTCODES: |
|
82 | + return wp_strip_all_tags( preg_replace( '/\[[^]]+\]/', '', do_shortcode( $post->post_content ) ) ); |
|
83 | + |
|
84 | + // Author. |
|
85 | + case self::AUTHOR: |
|
86 | + return $post->post_author; |
|
87 | + } |
|
88 | + |
|
89 | + return null; |
|
90 | + } |
|
91 | 91 | |
92 | 92 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @param string $property A post property. |
51 | 51 | */ |
52 | - public function __construct( $property ) { |
|
52 | + public function __construct($property) { |
|
53 | 53 | |
54 | 54 | $this->property = $property; |
55 | 55 | |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | * @return array|string|null A single string, or an array of values or null |
66 | 66 | * if the property isn't recognized. |
67 | 67 | */ |
68 | - public function get( $post_id ) { |
|
68 | + public function get($post_id) { |
|
69 | 69 | |
70 | 70 | // Get the post. |
71 | - $post = get_post( $post_id ); |
|
71 | + $post = get_post($post_id); |
|
72 | 72 | |
73 | 73 | // Switch according to the selected property. |
74 | - switch ( $this->property ) { |
|
74 | + switch ($this->property) { |
|
75 | 75 | |
76 | 76 | // Title. |
77 | 77 | case self::TITLE: |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | // Description. |
81 | 81 | case self::DESCRIPTION_NO_TAGS_NO_SHORTCODES: |
82 | - return wp_strip_all_tags( preg_replace( '/\[[^]]+\]/', '', do_shortcode( $post->post_content ) ) ); |
|
82 | + return wp_strip_all_tags(preg_replace('/\[[^]]+\]/', '', do_shortcode($post->post_content))); |
|
83 | 83 | |
84 | 84 | // Author. |
85 | 85 | case self::AUTHOR: |
@@ -10,22 +10,22 @@ |
||
10 | 10 | */ |
11 | 11 | class Simple_Http_Client implements Http_Client { |
12 | 12 | |
13 | - /** |
|
14 | - * @inheritDoc |
|
15 | - */ |
|
16 | - public function get( $url, $options = array() ) { |
|
13 | + /** |
|
14 | + * @inheritDoc |
|
15 | + */ |
|
16 | + public function get( $url, $options = array() ) { |
|
17 | 17 | |
18 | - $options['method'] = 'GET'; |
|
18 | + $options['method'] = 'GET'; |
|
19 | 19 | |
20 | - return $this->request( $url, $options ); |
|
21 | - } |
|
20 | + return $this->request( $url, $options ); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * @inheritDoc |
|
25 | - */ |
|
26 | - public function request( $url, $options = array() ) { |
|
23 | + /** |
|
24 | + * @inheritDoc |
|
25 | + */ |
|
26 | + public function request( $url, $options = array() ) { |
|
27 | 27 | |
28 | - return wp_remote_request( $url, $options ); |
|
29 | - } |
|
28 | + return wp_remote_request( $url, $options ); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | } |
@@ -13,19 +13,19 @@ |
||
13 | 13 | /** |
14 | 14 | * @inheritDoc |
15 | 15 | */ |
16 | - public function get( $url, $options = array() ) { |
|
16 | + public function get($url, $options = array()) { |
|
17 | 17 | |
18 | 18 | $options['method'] = 'GET'; |
19 | 19 | |
20 | - return $this->request( $url, $options ); |
|
20 | + return $this->request($url, $options); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | 24 | * @inheritDoc |
25 | 25 | */ |
26 | - public function request( $url, $options = array() ) { |
|
26 | + public function request($url, $options = array()) { |
|
27 | 27 | |
28 | - return wp_remote_request( $url, $options ); |
|
28 | + return wp_remote_request($url, $options); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @return string The excerpt. |
40 | 40 | */ |
41 | - public static function get_text_excerpt( $post, $length = 55, $more = '...' ) { |
|
41 | + public static function get_text_excerpt($post, $length = 55, $more = '...') { |
|
42 | 42 | |
43 | 43 | /* |
44 | 44 | * Apply the `wl_post_content` filter, in case 3rd parties want to change the post content, e.g. |
@@ -46,16 +46,16 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @since 3.20.0 |
48 | 48 | */ |
49 | - $post_content = apply_filters( 'wl_post_content', $post->post_content, $post ); |
|
49 | + $post_content = apply_filters('wl_post_content', $post->post_content, $post); |
|
50 | 50 | |
51 | 51 | // Filter shortcode content in post_content, before using it for trimming |
52 | - $post_content = do_shortcode( $post_content ); |
|
52 | + $post_content = do_shortcode($post_content); |
|
53 | 53 | |
54 | 54 | // Get the excerpt and trim it. Use the `post_excerpt` if available. |
55 | - $excerpt = wp_trim_words( ! empty( $post->post_excerpt ) ? $post->post_excerpt : $post_content, $length, $more ); |
|
55 | + $excerpt = wp_trim_words( ! empty($post->post_excerpt) ? $post->post_excerpt : $post_content, $length, $more); |
|
56 | 56 | |
57 | 57 | // Remove shortcodes and decode html entities. |
58 | - return html_entity_decode( self::strip_all_shortcodes( $excerpt ) ); |
|
58 | + return html_entity_decode(self::strip_all_shortcodes($excerpt)); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @return string The content without shortcodes. |
71 | 71 | */ |
72 | - private static function strip_all_shortcodes( $content ) { |
|
72 | + private static function strip_all_shortcodes($content) { |
|
73 | 73 | |
74 | - return preg_replace( '/\[[^]]+\]/', '', $content ); |
|
74 | + return preg_replace('/\[[^]]+\]/', '', $content); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | } |
@@ -23,55 +23,55 @@ |
||
23 | 23 | */ |
24 | 24 | class Wordlift_Post_Excerpt_Helper { |
25 | 25 | |
26 | - /** |
|
27 | - * Get the text excerpt for the provided {@link WP_Post}. |
|
28 | - * |
|
29 | - * Since anyone can hook on the excerpt generation filters, and |
|
30 | - * amend it with non textual content, we play it self and generate |
|
31 | - * the excerpt ourselves, mimicking the way WordPress core does it. |
|
32 | - * |
|
33 | - * @since 3.10.0 |
|
34 | - * |
|
35 | - * @param WP_Post $post The {@link WP_Post}. |
|
36 | - * @param int $length The desired excerpt length. |
|
37 | - * @param string $more The desired more string. |
|
38 | - * |
|
39 | - * @return string The excerpt. |
|
40 | - */ |
|
41 | - public static function get_text_excerpt( $post, $length = 55, $more = '...' ) { |
|
26 | + /** |
|
27 | + * Get the text excerpt for the provided {@link WP_Post}. |
|
28 | + * |
|
29 | + * Since anyone can hook on the excerpt generation filters, and |
|
30 | + * amend it with non textual content, we play it self and generate |
|
31 | + * the excerpt ourselves, mimicking the way WordPress core does it. |
|
32 | + * |
|
33 | + * @since 3.10.0 |
|
34 | + * |
|
35 | + * @param WP_Post $post The {@link WP_Post}. |
|
36 | + * @param int $length The desired excerpt length. |
|
37 | + * @param string $more The desired more string. |
|
38 | + * |
|
39 | + * @return string The excerpt. |
|
40 | + */ |
|
41 | + public static function get_text_excerpt( $post, $length = 55, $more = '...' ) { |
|
42 | 42 | |
43 | - /* |
|
43 | + /* |
|
44 | 44 | * Apply the `wl_post_content` filter, in case 3rd parties want to change the post content, e.g. |
45 | 45 | * because the content is written elsewhere. |
46 | 46 | * |
47 | 47 | * @since 3.20.0 |
48 | 48 | */ |
49 | - $post_content = apply_filters( 'wl_post_content', $post->post_content, $post ); |
|
49 | + $post_content = apply_filters( 'wl_post_content', $post->post_content, $post ); |
|
50 | 50 | |
51 | - // Filter shortcode content in post_content, before using it for trimming |
|
52 | - $post_content = do_shortcode( $post_content ); |
|
51 | + // Filter shortcode content in post_content, before using it for trimming |
|
52 | + $post_content = do_shortcode( $post_content ); |
|
53 | 53 | |
54 | - // Get the excerpt and trim it. Use the `post_excerpt` if available. |
|
55 | - $excerpt = wp_trim_words( ! empty( $post->post_excerpt ) ? $post->post_excerpt : $post_content, $length, $more ); |
|
54 | + // Get the excerpt and trim it. Use the `post_excerpt` if available. |
|
55 | + $excerpt = wp_trim_words( ! empty( $post->post_excerpt ) ? $post->post_excerpt : $post_content, $length, $more ); |
|
56 | 56 | |
57 | - // Remove shortcodes and decode html entities. |
|
58 | - return html_entity_decode( self::strip_all_shortcodes( $excerpt ) ); |
|
59 | - } |
|
57 | + // Remove shortcodes and decode html entities. |
|
58 | + return html_entity_decode( self::strip_all_shortcodes( $excerpt ) ); |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * Remove all the shortcodes from the content. We're using our own function |
|
63 | - * because WordPress' own `strip_shortcodes` only takes into consideration |
|
64 | - * shortcodes for installed plugins/themes. |
|
65 | - * |
|
66 | - * @since 3.12.0 |
|
67 | - * |
|
68 | - * @param string $content The content with shortcodes. |
|
69 | - * |
|
70 | - * @return string The content without shortcodes. |
|
71 | - */ |
|
72 | - private static function strip_all_shortcodes( $content ) { |
|
61 | + /** |
|
62 | + * Remove all the shortcodes from the content. We're using our own function |
|
63 | + * because WordPress' own `strip_shortcodes` only takes into consideration |
|
64 | + * shortcodes for installed plugins/themes. |
|
65 | + * |
|
66 | + * @since 3.12.0 |
|
67 | + * |
|
68 | + * @param string $content The content with shortcodes. |
|
69 | + * |
|
70 | + * @return string The content without shortcodes. |
|
71 | + */ |
|
72 | + private static function strip_all_shortcodes( $content ) { |
|
73 | 73 | |
74 | - return preg_replace( '/\[[^]]+\]/', '', $content ); |
|
75 | - } |
|
74 | + return preg_replace( '/\[[^]]+\]/', '', $content ); |
|
75 | + } |
|
76 | 76 | |
77 | 77 | } |