1 | <?php |
||
37 | final class Metabox |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * Subway visibility meta value, |
||
42 | * |
||
43 | * @since 2.0.9 |
||
44 | * @const string VISIBILITY_METAKEY |
||
45 | */ |
||
46 | const VISIBILITY_METAKEY = 'subway_visibility_meta_key'; |
||
47 | |||
48 | /** |
||
49 | * Registers and update metabox with its intended method below. |
||
50 | * |
||
51 | * @since 2.0.9 |
||
52 | * @return void |
||
|
|||
53 | */ |
||
54 | public function __construct() |
||
71 | |||
72 | /** |
||
73 | * Initialize metabox |
||
74 | * |
||
75 | * @since 2.0.9 |
||
76 | * @access public |
||
77 | * @return void |
||
78 | */ |
||
79 | public static function initMetabox() |
||
83 | |||
84 | /** |
||
85 | * Initialize metabox |
||
86 | * |
||
87 | * @since 2.0.9 |
||
88 | * @access public |
||
89 | * @return void |
||
90 | */ |
||
91 | public function addMetabox() |
||
106 | |||
107 | /** |
||
108 | * This method displays the Subway Visibility checkbox. |
||
109 | * |
||
110 | * @param object $post Contains data from the current post. |
||
111 | * |
||
112 | * @since 2.0.9 |
||
113 | * @access public |
||
114 | * @return void |
||
115 | */ |
||
116 | public function visibilityMetabox( $post ) |
||
193 | |||
194 | /** |
||
195 | * This method verify if nonce is valid then updates a post_meta. |
||
196 | * |
||
197 | * @param integer $post_id Contains ID of the current post. |
||
198 | * |
||
199 | * @since 2.0.9 |
||
200 | * @access public |
||
201 | * @return boolean false Returns false if nonce is not valid. |
||
202 | */ |
||
203 | public function saveVisibilityMetabox( $post_id = '' ) |
||
263 | |||
264 | /** |
||
265 | * This method runs the methods that handles the update for a post_meta. |
||
266 | * |
||
267 | * @param integer $post_id Contains ID of the current post. |
||
268 | * |
||
269 | * @since 2.0.9 |
||
270 | * @access public |
||
271 | * @return boolean false Returns false if nonce is not valid. |
||
272 | */ |
||
273 | public function saveMetaboxValues( $post_id ) |
||
278 | |||
279 | /** |
||
280 | * Initialize metabox arguments. |
||
281 | * |
||
282 | * @param array $args The arguments for the get_post_types(). |
||
283 | * @param string $output Your desired output for the data. |
||
284 | * |
||
285 | * @since 2.0.9 |
||
286 | * @access public |
||
287 | * @return void |
||
288 | */ |
||
289 | public static function getPostTypes( $args = '', $output = '' ) |
||
302 | |||
303 | /** |
||
304 | * This method verify if nonce is valid. |
||
305 | * |
||
306 | * @param mixed $nonce the name of a metabox nonce. |
||
307 | * |
||
308 | * @since 2.0.9 |
||
309 | * @access public |
||
310 | * @return boolean true Returns true if nonce is valid. |
||
311 | */ |
||
312 | public function isNonceValid( $nonce ) |
||
320 | |||
321 | /** |
||
322 | * Checks if a post is set to private. |
||
323 | * |
||
324 | * @param integer $post_id Contains ID of the current post. |
||
325 | * |
||
326 | * @since 2.0.9 |
||
327 | * @access public |
||
328 | * @return boolean true Returns true if post is private. Otherwise false. |
||
329 | */ |
||
330 | public static function isPostPrivate( $post_id ) |
||
343 | |||
344 | /** |
||
345 | * Checks if a post is set to public. |
||
346 | * |
||
347 | * @param integer $post_id Contains ID of the current post. |
||
348 | * |
||
349 | * @since 2.0.9 |
||
350 | * @access public |
||
351 | * @return boolean true Returns true if post is public. Otherwise false. |
||
352 | */ |
||
353 | public static function isPostPublic( $post_id ) |
||
365 | |||
366 | } |
||
367 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.