File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
plugins/hwp-previews/src/Hooks Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,18 @@ public function __construct() {
4747 $ this ->post_settings_service = new Post_Settings_Service ();
4848 }
4949
50+ /**
51+ * Initialize the hooks for the preview functionality.
52+ */
53+ public static function init (): self {
54+ if ( ! isset ( self ::$ instance ) || ! ( is_a ( self ::$ instance , self ::class ) ) ) {
55+ self ::$ instance = new self ();
56+ self ::$ instance ->setup ();
57+ }
58+
59+ return self ::$ instance ;
60+ }
61+
5062 /**
5163 * Registers the hooks for the preview functionality.
5264 */
@@ -100,7 +112,8 @@ public function enable_post_statuses_as_parent( array $args ): array {
100112 return $ args ;
101113 }
102114
103- $ args ['post_status ' ] = $ this ->get_statuses_for_parent_post_type ();;
115+ $ args ['post_status ' ] = $ this ->get_statuses_for_parent_post_type ();
116+
104117 return $ args ;
105118 }
106119
@@ -239,19 +252,6 @@ public function generate_preview_url( WP_Post $post ): string {
239252 return (string ) $ service ->resolve ( $ post , $ url );
240253 }
241254
242- /**
243- * Initialize the hooks for the preview functionality.
244- */
245- public static function init (): self {
246- if ( ! isset ( self ::$ instance ) || ! ( is_a ( self ::$ instance , self ::class ) ) ) {
247- self ::$ instance = new self ();
248- self ::$ instance ->setup ();
249- }
250-
251- return self ::$ instance ;
252- }
253-
254-
255255 /**
256256 * @return array<string>
257257 */
You can’t perform that action at this time.
0 commit comments