#35057 closed defect (bug) (fixed)
bug in new default_hidden_columns filter
Reported by: | dwenaus | Owned by: | helen |
---|---|---|---|
Milestone: | 4.4.1 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Administration | Keywords: | has-patch commit |
Focuses: | administration | Cc: |
Description
This is a follow-up to #32499.
In the function get_hidden_columns() the simple test to see if the user has hidden columns or not is
if ( ! $hidden ) {
however that also happens when the user has chosen to show all columns, it's and empty array.
better would be
if ( $hidden === false ) {
that way the default_hidden_columns filter will only fire if the user option does not exist at all.
Attachments (3)
Change History (17)
#4
@
9 years ago
@voldemortensen patch looks good to me. Now an empty array would return false and skip the filter.
#5
@
9 years ago
Guess it would make sense to check for false. Either that, or do the same as the get_hidden_meta_boxes function is doing:
$use_defaults = ! is_array( $hidden ); // Hide slug boxes by default if ( $use_defaults ) { ...
Either way I really think that both get_hidden_meta_boxes() and get_hidden_columns() should use the same method for consistency.
#6
@
9 years ago
I like the idea of using the same method we are using elsewhere.
A few small notes on your patch @Compute:
- Let's not change formatting of the lines not directly being changed. This can mess up debugging with
svn blame
, so even if they don't match the current code standards, we shouldn't change them. - Adding the additional param to the hidden_columns filter means we also need to add an
@since
with the changelog. See https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#since-section-changelogs
This ticket was mentioned in Slack in #core by jorbin. View the logs.
9 years ago
#8
@
9 years ago
I'm assuming that only the first chunk of the patch is applicable and the second is formatting changes that shouldn't go in right now. I'm not all that excited about adding a param in a point release, but it seems okay. The docblock needs to be corrected from the copy-paste, though.
#9
@
9 years ago
- Keywords commit added; needs-testing removed
While I also am hesitant to add a param in a point release, it is a new filter which means not including it is more of a bug than an enhancement.
New patch added without the formatting changes.
#13
@
9 years ago
I don't know if this is the right thread for me, since I upgraded WP to 4.4 and 4.4.1 below, the plugin Advanced WP columns is not responsive, you do not see the two columns on the page as before, lately I updated Genesis framework to version 2.2.6, I asked the question even the developer of the plugin, but I had no answer. the mobile version you view one column not aligned , the same desktop view, only that in desktop if I reduce a point zoom reappear the two columns
@helen, @Compute, @MikeHansenMe, @chriscct7 - This is a followup to [33689] which you all worked on, can you please take a look at the patch and comment with your thoughts?