Skip to content

Commit 7d6ae34

Browse files
committed
Merge branch 'main' into chore-logging-develop-event-lifecycle
2 parents 8b91af6 + 08e8ea4 commit 7d6ae34

File tree

8 files changed

+85
-28
lines changed

8 files changed

+85
-28
lines changed

plugins/composer-packages.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
11
{
22
"packages": {
33
"wpengine/hwp-previews": {
4+
"0.0.9": {
5+
"name": "wpengine/hwp-previews",
6+
"version": "0.0.9",
7+
"type": "wordpress-plugin",
8+
"description": "A WordPress plugin for headless previews.",
9+
"homepage": "https://github.com/wpengine/hwptoolkit",
10+
"license": "GPL-2.0",
11+
"authors": [
12+
{
13+
"name": "WP Engine Headless OSS Development Team",
14+
"email": "[email protected]",
15+
"homepage": "https://wpengine.com/"
16+
}
17+
],
18+
"support": {
19+
"issues": "https://github.com/wpengine/hwptoolkit/issues",
20+
"email": "[email protected]"
21+
},
22+
"dist": {
23+
"url": "https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fhwp-previews-wordpress-plugin-0.0.9/hwp-previews.zip",
24+
"type": "zip"
25+
},
26+
"require": {
27+
"composer/installers": "~1.0 || ~2.0"
28+
}
29+
},
430
"0.0.8": {
531
"name": "wpengine/hwp-previews",
632
"version": "0.0.8",

plugins/hwp-previews/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# HWP Previews
22

3+
## 0.0.9
4+
5+
### Patch Changes
6+
7+
- [#370](https://github.com/wpengine/hwptoolkit/pull/370) [`e8f3904`](https://github.com/wpengine/hwptoolkit/commit/e8f39041e114a05db37de6dc38714e278a2d9f95) Thanks [@colinmurphy](https://github.com/colinmurphy)! - bug: Fixed issue with retrieving post types before ACF hook initialisation.
8+
39
## 0.0.8
410

511
### Patch Changes

plugins/hwp-previews/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "wordpress-plugin",
44
"description": "A WordPress plugin for headless previews.",
55
"license": "GPL-2.0",
6-
"version": "0.0.8",
6+
"version": "0.0.9",
77
"authors": [
88
{
99
"name": "WP Engine Headless OSS Development Team",

plugins/hwp-previews/hwp-previews.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Author: WPEngine Headless OSS Team
88
* Author URI: https://github.com/wpengine
99
* Update URI: https://github.com/wpengine/hwptoolkit
10-
* Version: 0.0.8
10+
* Version: 0.0.9
1111
* Text Domain: hwp-previews
1212
* Domain Path: /languages
1313
* Requires at least: 6.0
@@ -67,7 +67,7 @@ function hwp_previews_init(): void {
6767
*/
6868
function hwp_previews_constants(): void {
6969
if ( ! defined( 'HWP_PREVIEWS_VERSION' ) ) {
70-
define( 'HWP_PREVIEWS_VERSION', '0.0.8' );
70+
define( 'HWP_PREVIEWS_VERSION', '0.0.9' );
7171
}
7272

7373
if ( ! defined( 'HWP_PREVIEWS_PLUGIN_DIR' ) ) {

plugins/hwp-previews/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wpengine/hwp-previews-wordpress-plugin",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"private": true,
55
"description": "Headless Previews solution for WordPress: fully configurable preview URLs via the settings page.",
66
"scripts": {

plugins/hwp-previews/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: GraphQL, Headless, Previews, WPGraphQL, React, Rest
44
Requires at least: 6.0
55
Tested up to: 6.8.1
66
Requires PHP: 7.4
7-
Stable tag: 0.0.8
7+
Stable tag: 0.0.9
88
License: GPL-2.0
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010

plugins/hwp-previews/src/Preview/Post/Post_Preview_Service.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,11 @@ class Post_Preview_Service {
3535
*/
3636
protected $parent_post_statuses = [];
3737

38-
/**
39-
* Constructor for the Post_Preview_Service class.
40-
*
41-
* Initializes the allowed post-types and statuses for previews.
42-
*/
43-
public function __construct() {
44-
$this->set_post_types();
45-
$this->set_post_statuses();
46-
$this->set_post_parent_statuses();
47-
}
48-
4938
/**
5039
* @return array<string>
5140
*/
5241
public function get_allowed_post_types(): array {
53-
return $this->post_types;
42+
return $this->get_post_types();
5443
}
5544

5645
/**
@@ -59,6 +48,11 @@ public function get_allowed_post_types(): array {
5948
* @return array<string>
6049
*/
6150
public function get_post_statuses(): array {
51+
$post_statuses = $this->post_statuses;
52+
if ([] !== $post_statuses) {
53+
return $post_statuses;
54+
}
55+
$this->set_post_statuses();
6256
return $this->post_statuses;
6357
}
6458

@@ -68,6 +62,11 @@ public function get_post_statuses(): array {
6862
* @return array<string>
6963
*/
7064
public function get_post_types(): array {
65+
$post_types = $this->post_types;
66+
if ([] !== $post_types) {
67+
return $post_types;
68+
}
69+
$this->set_post_types();
7170
return $this->post_types;
7271
}
7372

@@ -77,6 +76,11 @@ public function get_post_types(): array {
7776
* @return array<string>
7877
*/
7978
public function get_parent_post_statuses(): array {
79+
$parent_post_statuses = $this->parent_post_statuses;
80+
if ([] !== $parent_post_statuses) {
81+
return $parent_post_statuses;
82+
}
83+
$this->set_post_parent_statuses();
8084
return $this->parent_post_statuses;
8185
}
8286

pnpm-lock.yaml

Lines changed: 32 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)