-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Rename post_states_string to post_states_html and improve phpdoc
#10360
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
Rename post_states_string to post_states_html and improve phpdoc
#10360
Conversation
src/wp-admin/includes/template.php
Outdated
| * @param string $post_states_string The post states HTML string. | ||
| * @param string[] $post_states The post states. | ||
| * @param WP_Post $post The current post object. | ||
| * @param string $post_states_html All relevant post sta60986tes combined into an HTML string for display. |
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.
looks like a typo, perhaps accidentally pasting in 60986?
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
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.
Fixed in f9236b8
src/wp-admin/includes/template.php
Outdated
| * @param string $post_states_html All relevant post sta60986tes combined into an HTML string for display. | ||
| * E.g. `— <span class='post-state'>Draft, </span><span class='post-state'>Sticky</span>`. | ||
| * @param string<string, string> $post_states A mapping of post state slugs to translated post state labels. | ||
| * E.g. `array( 'draft' => 'Draft', 'sticky' => 'Sticky' )`. |
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.
while this is great already, do you think it could help or possibly add confusion if we showed the translation function?
* E.g. `array( 'draft' => __( 'Draft' ), … )`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 idea. Added in c902961
| * | ||
| * @param string[] $post_states An array of post display states. | ||
| * @param WP_Post $post The current post object. | ||
| * @param string<string, string> $post_states A mapping of post state slugs to translated post state labels. |
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.
so very helpful!
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.
Added example in c902961
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.
I mean, added to the display_post_states filter as well.
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Co-authored-by: Dennis Snell <dmsnell@git.wordpress.org>
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.
Love it
…ates_html`. Add examples to the PHPDoc for the filter params. Developed in #10360 Follow-up to [60986]. Props dmsnell, westonruter. See #51403. git-svn-id: https://develop.svn.wordpress.org/trunk@60993 602fd350-edb4-49c9-b593-d223f7449a82
…ates_html`. Add examples to the PHPDoc for the filter params. Developed in WordPress/wordpress-develop#10360 Follow-up to [60986]. Props dmsnell, westonruter. See #51403. Built from https://develop.svn.wordpress.org/trunk@60993 git-svn-id: http://core.svn.wordpress.org/trunk@60329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ates_html`. Add examples to the PHPDoc for the filter params. Developed in WordPress/wordpress-develop#10360 Follow-up to [60986]. Props dmsnell, westonruter. See #51403. Built from https://develop.svn.wordpress.org/trunk@60993 git-svn-id: https://core.svn.wordpress.org/trunk@60329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Trac ticket: https://core.trac.wordpress.org/ticket/51403
Follow-up to #10000
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.