Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Block Bindings: Don't show protected fields that are bound to blocks and post meta #6197
Block Bindings: Don't show protected fields that are bound to blocks and post meta #6197
Changes from 13 commits
105ffe1
00b4d65
46a29e4
0b106f9
1736c83
1fb2c47
81d4e34
8d0a0be
ce4aa0c
f1655d6
01d45e5
7d25302
dfe02a5
6414a97
193131f
a0b761b
4cdf241
6e37a4c
8389270
953058d
bc81da4
64f0784
56beecc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't much value in having that code extracted from its method since it's used only once. It would make the code easier to follow if it was inlined.
You could also avoid adding inline comments by making the code structured like that:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
self::$post
variable is useless anyway because the whole class only operates on the global post.We can just always work on the global post if that is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried using the global $post variable only for all the tests, but something is not working as I expected.
It seems that the value of the global
$post
variable isundefined
(or the value I defined inwpSetUpBeforeClass
) for the FIRST tests. For the following tests, the global$post
variable becomes always null unless I redefine it.This happens even if I remove all the logic and I just access that variable.
The way I'm solving that is storing the $post object in a private property when the post is initialized: link. And for each test I assign the global variable to that: link.
However, this feels like a workaround. Any idea if that is expected or how it could be solved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per my other comment, the static
$post
variable is redundant if you make it global anyway.