-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 missing variable reference in meta-box-partial-page.php #3092
Conversation
Fix minor PHP error. See #2804 (comment)
lib/meta-box-partial-page.php
Outdated
@@ -69,9 +69,12 @@ function gutenberg_meta_box_partial_page( $post_type, $meta_box_context ) { | |||
|
|||
global $post, $wp_meta_boxes, $hook_suffix, $current_screen, $wp_locale; | |||
|
|||
// This page should always match up with the edit action. | |||
$action = 'edit'; |
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.
If $action
is always 'edit'
and gutenberg_meta_box_partial_page_post_form
is only ever called from here, is the 'edit' === $action
even necessary? Are we expecting gutenberg_meta_box_partial_page_post_form
to be called in other contexts?
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.
Are we expecting gutenberg_meta_box_partial_page_post_form to be called in other contexts?
I do not know. We can most likely get rid of this code then? I am fairly positive that metaboxes only ever display if the edit action is set on post.php, but that could be wrong. In this code I am setting it to be edit anyways, so it is probably best to just eliminate any of the code using action.
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.
Let me know if you want to merge as is, or remove any reference to action since it should always be edit anyways.
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.
Let me know if you want to merge as is, or remove any reference to action since it should always be edit anyways.
I'm content with either, but if we don't anticipate to need to check $action
, probably best to remove.
The $action variable is not relavent in this context of meta boxes, as the $action should always be `edit`. We can assume that is the case. In the future if other contexts are needed we can address those case by case.
2e261f1
to
b68a7e1
Compare
Codecov Report
@@ Coverage Diff @@
## master #3092 +/- ##
=========================================
- Coverage 32.24% 31.7% -0.54%
=========================================
Files 216 216
Lines 6150 6273 +123
Branches 1081 1128 +47
=========================================
+ Hits 1983 1989 +6
- Misses 3516 3587 +71
- Partials 651 697 +46
Continue to review full report at Codecov.
|
Fix minor PHP error. See
#2804 (comment)