Skip to content

Conversation

@colinmurphy
Copy link
Member

@colinmurphy colinmurphy commented Aug 13, 2025

…e is setting values in the constructor means ACF hooks have not fired.

Description

Issue is that ACF post types are not being picked up HWP Previews for the settings page (or any other related post type functionality).

After some investigating it was the Post Preview Service is being called before ACF hook initialisation to register those custom post types.

Fix: A small refactor that the post preview service would not set post_type, post_status on initialisation but rather when a getter method is called, to check if the property is not empty and then set the data.

Related Issue

Fixes #368

Dependant PRs

Type of Change

  • ✅ Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactoring (no functional changes)
  • 📄 Example update (no functional changes)
  • 📝 Documentation update
  • 🔍 Performance improvement
  • 🧪 Test update

How Has This Been Tested?

Screenshots

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the project's coding standards
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • Any dependent changes have been highlighted, merged or published

…e is setting values in the constructor means ACF hooks have not fired.
@changeset-bot
Copy link

changeset-bot bot commented Aug 13, 2025

🦋 Changeset detected

Latest commit: fc66722

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@wpengine/hwp-previews-wordpress-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link

github-actions bot commented Aug 13, 2025

ℹ️ Download the latest hwp-previews plugin zip from this PR
(See the 'Artifacts' section at the bottom)

@colinmurphy colinmurphy changed the title bug: Fixed post type initialisation before ACF hooks fix: Fixed post type initialisation before ACF hooks Aug 13, 2025
@colinmurphy colinmurphy marked this pull request as ready for review August 13, 2025 12:28
@colinmurphy colinmurphy requested a review from a team as a code owner August 13, 2025 12:28
@colinmurphy colinmurphy enabled auto-merge August 13, 2025 12:29
@colinmurphy colinmurphy added this pull request to the merge queue Aug 13, 2025
Merged via the queue into main with commit 2d49bf0 Aug 13, 2025
26 of 32 checks passed
@colinmurphy colinmurphy deleted the bug-fix-acf-post-types-for-previews branch August 13, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ACF Custom Post Type not showing in HWP Previews

3 participants