Skip to content
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 some docblock types related to the Template Registration API #65187

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

Aljullu
Copy link
Contributor

@Aljullu Aljullu commented Sep 10, 2024

What?

This PR applies changes introduced in WordPress/wordpress-develop#7125 during the code review phase. These changes correct incorrect types in PHP function doc blocks.

Kudos to @anton-vlasenko for finding those issues.

Why?

During the refactor in #61577, I missed updating some doc blocks. They were identified during the WP core PR review, so I'm applying the corrections to Gutenberg as well.

How?

The changes are limited to correcting the wrong type data in doc block comments.

Testing Instructions

Since the changes are purely within the doc block comments, no functionality testing is required. Simply verify the accuracy of the updated doc blocks.

Testing Instructions for Keyboard

N/A

Screenshots or screencast

N/A

@Aljullu Aljullu self-assigned this Sep 10, 2024
@Aljullu Aljullu marked this pull request as ready for review September 10, 2024 10:14
Copy link

github-actions bot commented Sep 10, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Aljullu <[email protected]>
Co-authored-by: ntsekouras <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Aljullu Aljullu added the [Type] Developer Documentation Documentation for developers label Sep 10, 2024
Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides my small comments, this looks good. Thank you!

@@ -2,3 +2,4 @@ https://github.com/WordPress/wordpress-develop/pull/7125

* https://github.com/WordPress/gutenberg/pull/61577
* https://github.com/WordPress/gutenberg/pull/64610
* https://github.com/WordPress/gutenberg/pull/65187
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these changes are going to land first in core, I don't think we need this entry to mark this PR for backport, do we?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I wasn't sure either. I reverted the change and added the Backport from WordPress Core label so the job passes.

@@ -33,7 +32,7 @@ function wp_register_block_template( $template_name, $args = array() ) {
* Unregister a template.
*
* @param string $template_name Template name in the form of `plugin_uri//template_name`.
* @return true|WP_Error True on success, WP_Error on failure or if the template doesn't exist.
* @return WP_Block_Template|WP_Error True on success, WP_Error on failure or if the template doesn't exist.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the True on success part need to change here and at the core PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed in d5b7efe.

@Aljullu Aljullu force-pushed the fix/block-template-registration-docblock-fixes branch from 6072dcb to d5b7efe Compare September 10, 2024 11:09
@Aljullu Aljullu added Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core [Type] Developer Documentation Documentation for developers and removed [Type] Developer Documentation Documentation for developers Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core labels Sep 10, 2024
Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change that is needed and 🚢 . Thank you!

lib/compat/wordpress-6.7/block-templates.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants