-
Notifications
You must be signed in to change notification settings - Fork 116
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
Use $column_name
instead of $column_title
and deprecate redundant filter
#1519
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -391,37 +391,33 @@ public function column_default( $item, $column_name ) { | |
* Registers new Columns to be inserted into the table. The cell contents of this column is set | ||
* below with 'wp_stream_insert_column_default_' | ||
* | ||
* @param array $new_columns Columns injected in the table. | ||
* @since 3.5.1 | ||
* @deprecated 4.0.1 Use the {@see 'wp_stream_list_table_columns'} filter instead. | ||
* | ||
* @param array $new_columns Columns injected in the table. | ||
* | ||
* @return array | ||
*/ | ||
$inserted_columns = apply_filters( 'wp_stream_register_column_defaults', array() ); | ||
|
||
if ( ! empty( $inserted_columns ) && is_array( $inserted_columns ) ) { | ||
foreach ( $inserted_columns as $column_title ) { | ||
/** | ||
* If column title inserted via wp_stream_register_column_defaults ($column_title) exists | ||
* among columns registered with get_columns ($column_name) and there is an action associated | ||
* with this column, do the action | ||
* | ||
* Also, note that the action name must include the $column_title registered | ||
* with wp_stream_register_column_defaults | ||
*/ | ||
if ( $column_title === $column_name ) { | ||
/** | ||
* Allows for the addition of content under a specified column. | ||
* | ||
* @param string $out Column content. | ||
* @param object $record Record with row content. | ||
* @param string $column_name Column name. | ||
* | ||
* @return string | ||
*/ | ||
$out = apply_filters( "wp_stream_insert_column_default_{$column_title}", $out, $record, $column_name ); | ||
break; | ||
} | ||
} | ||
} | ||
apply_filters_deprecated( | ||
'wp_stream_register_column_defaults', | ||
array( array() ), | ||
/* translators: %s is the Stream version number. It is part of a filter deprecation notice and is preceded by: "{hook_name} is deprecated since version %s of Stream". */ | ||
sprintf( __( '%s of Stream', 'stream' ), '4.0.1' ), | ||
'wp_stream_list_table_columns', | ||
__( 'Usage of this filter is redundant. Instead, define custom column name and title using the `wp_stream_list_table_columns` filter and provide the default value using the `wp_stream_insert_column_default_{$column_name}` filter.', 'stream' ) | ||
); | ||
|
||
/** | ||
* Allows for the addition of content under a specified column. | ||
* | ||
* @param string $out Column content. | ||
* @param object $record Record with row content. | ||
* @param string $column_name Column name. | ||
* | ||
* @return string | ||
*/ | ||
$out = (string) apply_filters( "wp_stream_insert_column_default_{$column_name}", $out, $record, $column_name ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 note: This is where the main fix is: note the change from |
||
break; | ||
} | ||
|
||
$allowed_tags = wp_kses_allowed_html( 'post' ); | ||
|
Oops, something went wrong.
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.
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.
🧹 chore: Please help me refine the copy here. I'm not sure if that sounds well (and correct in general).
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.
Maybe ...