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

Add has_block function and unit tests for it #9058

Merged

Conversation

andreilupu
Copy link
Contributor

Description

A refresh for #8340

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@andreilupu andreilupu mentioned this pull request Aug 16, 2018
4 tasks
lib/register.php Outdated
}
}

if ( ! has_blocks( $post ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check could probably moved to the top of the function. If there are no blocks, getting the post before hand seems superfluous.

@obenland obenland added this to the 3.6 milestone Aug 16, 2018
@obenland obenland added [Type] Enhancement A suggestion for improvement. [Feature] Block API API that allows to express the block paradigm. labels Aug 16, 2018
@obenland obenland modified the milestones: 3.6, 3.7 Aug 16, 2018
@obenland
Copy link
Member

@mtias Looks like this is too late for 3.6?

@pento
Copy link
Member

pento commented Aug 17, 2018

Wonderful, thanks @andreilupu!

I think we can safely put this into 3.6, it's a useful addition.

@pento pento modified the milestones: 3.7, 3.6 Aug 17, 2018
@pento pento merged commit b38a937 into WordPress:master Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants