WordPress.org

Make WordPress Core

Opened 8 days ago

Closed 8 days ago

Last modified 7 days ago

#51825 closed defect (bug) (fixed)

Spelling error on category-template.php

Reported by: princeahmed Owned by: SergeyBiryukov
Milestone: 5.7 Priority: normal
Severity: normal Version: trunk
Component: Taxonomy Keywords: has-patch
Focuses: docs Cc:

Description

On wp-includes/category-template.php file there is a spelling error in the documentation of the in_category function.

It is saying array of said instead of array of IDs.

Attachments (1)

51825.patch (1.0 KB) - added by princeahmed 8 days ago.
Created Patch

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
8 days ago

  • Component changed from General to Taxonomy
  • Milestone changed from Awaiting Review to 5.7

Hi there, welcome to WordPress Trac! Thanks for the ticket.

Just to clarify, the documentation means that the function accepts not only an array of category IDs, but also an array of category names or slugs. I agree this could be described better though :)

#2 follow-up: @SergeyBiryukov
8 days ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 49669:

Docs: Use more specific type in parameter descriptions for in_category() and is_object_in_term().

This better aligns with is_category() and other conditional tags and their WP_Query counterpart methods.

Follow-up to [47402].

Props princeahmed.
Fixes #51825.

@princeahmed
8 days ago

Created Patch

This ticket was mentioned in PR #752 on WordPress/wordpress-develop by princeahmed.


8 days ago

  • Keywords has-patch added

On wp-includes/category-template.php file there is a spelling error in the documentation of the in_category function.
It is saying array of said instead of array of IDs.

Trac ticket: https://core.trac.wordpress.org/ticket/51825

#4 @prbot
8 days ago

github-actions[bot] commented on PR #752:

Hi @princeahmed! 👋

Thank you for your contribution to WordPress! 💖

It looks like this is your first pull request to wordpress-develop. Here are a few things to be aware of that may help you out!

No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description.

Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making.

More information about how GitHub pull requests can be used to contribute to WordPress can be found in this blog post.

Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook.

If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook.

The Developer Hub also documents the various coding standards that are followed:

Thank you,
The WordPress Project

#5 in reply to: ↑ 2 ; follow-up: @princeahmed
8 days ago

Should I submit another new ticket by improving the parameter descriptions for in_category() and is_object_in_term()?

Replying to SergeyBiryukov:

In 49669:

Docs: Use more specific type in parameter descriptions for in_category() and is_object_in_term().

This better aligns with is_category() and other conditional tags and their WP_Query counterpart methods.

Follow-up to [47402].

Props princeahmed.
Fixes #51825.

#6 in reply to: ↑ 5 @SergeyBiryukov
7 days ago

Replying to princeahmed:

Should I submit another new ticket by improving the parameter descriptions for in_category() and is_object_in_term()?

Thanks for the patch! Just to clarify, as previously noted in comment:1, the function accepts not only an array of category IDs, but also an array of category names or slugs, so 51825.patch is not quite correct.

This is now changed in [49669] to "Category ID, name, slug, or array of such to check against", for consistency with other conditional tags and WP_Query methods, see also [47401] and [47402].

If you have any further ideas on improving the descriptions, please share :)

Note: See TracTickets for help on using tickets.