Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Template Part 403 request error occurs in edit mode #68674

Conversation

dhananjaykuber
Copy link
Contributor

@dhananjaykuber dhananjaykuber commented Jan 15, 2025

Fixes #68670

What?

Prevents unnecessary API requests for post preview links when editing template parts in the site editor, which currently causes 403 errors to appear in the browser console.

How?

Modified the PostPreviewButton component to only fetch preview links when the post type is actually viewable. This is done by:

  1. Checking the viewable status early in the useSelect hook
  2. Only calling getEditedPostPreviewLink() if the content is viewable

@Mamaduka
Copy link
Member

Superseded by #68678.

@Mamaduka Mamaduka closed this Jan 15, 2025
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.

Template Part: 403 request error occurs in edit mode
2 participants