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 filter for customizing block arguments #3782
Conversation
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.
Minor change then it is ready 👍
* @see includes/blocks/compat.php | ||
* | ||
* @param {array} $args The block arguments as defined by register_block_type. | ||
* @param {string} $args Block name. |
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.
Param variable name needs to be updated.
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.
Oops! Fixed here: cb156c1
Updated WCPC to use the new filte here |
* @param {array} $block_args The block arguments as defined by register_block_type. | ||
* @param {string} $block_name Block name. | ||
*/ | ||
$block_args = apply_filters( 'sensei_block_type_args', $block_args, $block_name ); |
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 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.
Good catch! Fixed here: #3789
Changes proposed in this Pull Request
sensei_take_course_block_type_args
filter in favor of the genericsensei_block_type_args
.Notice that this is for backwards compatibility, and after the WP 5.5 we should use the
register_block_type_args
. See this PR for more details.Testing instructions
New/Updated Hooks
sensei_block_type_args
- For WordPress < 5.5, filters block arguments. For WordPress >= 5.5, useregister_block_type_args
instead.