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 and simplify is_using_gutenberg() #426

Merged
merged 2 commits into from
Jul 12, 2019
Merged

Fix and simplify is_using_gutenberg() #426

merged 2 commits into from
Jul 12, 2019

Conversation

helen
Copy link
Contributor

@helen helen commented Jul 12, 2019

Description of the Change

has_blocks() does a get_post() if you don't pass a string, which doesn't work for external posts (which presumably is what you're pulling). Better to pass a string.

Also simplifies the rest of the function down to just reproducing the check from has_blocks() if you're not in WP 5.0+.

Alternate Designs

Considered leaving the rest of the function alone but thought it best to just do it all at once.

Benefits

Far simplified codebase, no more fatal error, no more false positives.

Possible Drawbacks

Not seeing any.

Verification Process

Testing pulling and pushing posts written using block editor, both in network and external connections.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

Don't have a companion issue open but you can see here http://s.hyhs.me/7bfef432f30c

`has_blocks()` does a `get_post()` if you don't pass a string, which doesn't work for external posts (which presumably is what you're pulling). Better to pass a string.

Also simplifies the rest of the function down to just reproducing the check from `has_blocks()` if you're not in WP 5.0+.
@helen helen added this to the 1.5.0 milestone Jul 12, 2019
@helen helen requested a review from adamsilverstein July 12, 2019 17:05
@helen helen merged commit 99e95e8 into develop Jul 12, 2019
@helen helen deleted the fix/has_blocks branch July 18, 2019 01:38
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.

1 participant