Skip to content

Icons Registry: Extend search to include label and keywords fields#76481

Open
manhar-addweb wants to merge 1 commit intoWordPress:trunkfrom
manhar-addweb:feature/icon-rest-api-keyword-search
Open

Icons Registry: Extend search to include label and keywords fields#76481
manhar-addweb wants to merge 1 commit intoWordPress:trunkfrom
manhar-addweb:feature/icon-rest-api-keyword-search

Conversation

@manhar-addweb
Copy link

@manhar-addweb manhar-addweb commented Mar 13, 2026

What?

Extends get_registered_icons() in WP_Icons_Registry to search
against label and keywords fields in addition to name.

Why?

Currently the search parameter only matches icon names.
Part of SVG Icon API iteration for WordPress 7.1.

Closes #75715

How?

Updated the search logic in get_registered_icons() to check
name, label, and keywords fields using stripos().

Testing Instructions

Updated the search logic in get_registered_icons() to check
name, label, and keywords fields using stripos().

Testing Instructions for Keyboard

Screenshots or screencast

Before After

Use of AI Tools

@github-actions
Copy link

github-actions bot commented Mar 13, 2026

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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @manhar@addwebsolution.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: manhar@addwebsolution.

Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: manhar-addweb <manhar@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: hiroshisatoy <hiroshisato@git.wordpress.org>
Co-authored-by: alexandrebuffet <alexandrebuffet@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
Co-authored-by: mikemcalister <mmcalister@git.wordpress.org>
Co-authored-by: pbearne <pbearne@git.wordpress.org>
Co-authored-by: mrwweb <mrwweb@git.wordpress.org>
Co-authored-by: eric-michel <ytfeldrawkcab@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

@github-actions
Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Mar 13, 2026
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @manhar-addweb! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@manhar-addweb manhar-addweb force-pushed the feature/icon-rest-api-keyword-search branch 2 times, most recently from a800b50 to e7247eb Compare March 13, 2026 08:38
@manhar-addweb manhar-addweb force-pushed the feature/icon-rest-api-keyword-search branch from e7247eb to e2798f0 Compare March 13, 2026 08:39
@im3dabasia
Copy link
Contributor

Thank you for the PR, @manhar-addweb. This was actually addressed in #75878, which added search by label and was merged into trunk yesterday. It might be worth checking the latest trunk to see if the issue is already resolved.

@manhar-addweb
Copy link
Author

Thank you for the PR, @manhar-addweb. This was actually addressed in #75878, which added search by label and was merged into trunk yesterday. It might be worth checking the latest trunk to see if the issue is already resolved.

Thanks for the review! Closing this in favor of #75878.

@manhar-addweb
Copy link
Author

Thanks @im3dabasia

I checked #75878 - it covers label search only.

This PR also adds keywords field search as mentioned
in #75715:
"We could also reference the label field and an
optional keywords field."

I noticed the manifest.php does not have keywords yet.
I can extend this PR to:

  1. Add keywords support to manifest.php for core icons
  2. Update register() to accept keywords field

Should I proceed with this?

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

Labels

First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SVG Icon API: Iteration for WordPress 7.1

2 participants