1 | <?php |
||
6 | class Jetpack_Frame_Nonce_Preview { |
||
7 | static $instance = null; |
||
|
|||
8 | |||
9 | /** |
||
10 | * Returns the single instance of the Jetpack_Frame_Nonce_Preview object |
||
11 | * |
||
12 | * @since 4.4.0 |
||
13 | * |
||
14 | * @return Jetpack_Frame_Nonce_Preview |
||
15 | **/ |
||
16 | public static function get_instance() { |
||
23 | |||
24 | function __construct() { |
||
29 | |||
30 | /** |
||
31 | * Verify that frame nonce exists, and if so, validate the nonce by calling WP.com. |
||
32 | * |
||
33 | * @since 4.4.0 |
||
34 | * |
||
35 | * @return bool |
||
36 | */ |
||
37 | public function is_frame_nonce_valid() { |
||
52 | |||
53 | /** |
||
54 | * Conditionally add a hook on posts_results if this is the main query, a preview, and singular. |
||
55 | * |
||
56 | * @since 4.4.0 |
||
57 | * |
||
58 | * @param WP_Query $query |
||
59 | * |
||
60 | * @return WP_Query |
||
61 | */ |
||
62 | public function maybe_display_post( $query ) { |
||
73 | |||
74 | /** |
||
75 | * Conditionally set the first post to 'publish' if the frame nonce is valid and there is a post. |
||
76 | * |
||
77 | * @since 4.4.0 |
||
78 | * |
||
79 | * @param array $posts |
||
80 | * |
||
81 | * @return array |
||
82 | */ |
||
83 | public function set_post_to_publish( $posts ) { |
||
98 | } |
||
99 | |||
101 |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.