Skip to content

Conversation

@westonruter
Copy link
Member

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.

* @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.
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

OOPS

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in f9236b8

* @param string $post_states_html All relevant post sta60986tes combined into an HTML string for display.
* E.g. `&mdash; <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' )`.
Copy link
Member

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' ), … )`

Copy link
Member Author

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.
Copy link
Member

Choose a reason for hiding this comment

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

so very helpful!

Copy link
Member Author

Choose a reason for hiding this comment

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

Added example in c902961

Copy link
Member Author

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.

@github-actions
Copy link

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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props westonruter, dmsnell.

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

westonruter and others added 2 commits October 20, 2025 14:35
Co-authored-by: Dennis Snell <dmsnell@git.wordpress.org>
Copy link
Member

@dmsnell dmsnell left a comment

Choose a reason for hiding this comment

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

Love it

@westonruter westonruter requested a review from dmsnell October 20, 2025 21:39
pento pushed a commit that referenced this pull request Oct 20, 2025
…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
@westonruter
Copy link
Member Author

Committed in 4f3c923 (r60993)

markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Oct 20, 2025
…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
github-actions bot pushed a commit to platformsh/wordpress-performance that referenced this pull request Oct 20, 2025
…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
@github-actions
Copy link

Test using WordPress Playground

The 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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants