Skip to content

Docs: Ignore HTML API internals from public documentation#11078

Closed
sirreal wants to merge 9 commits intoWordPress:trunkfrom
sirreal:html-api/ignore-internal-methods-from-docs
Closed

Docs: Ignore HTML API internals from public documentation#11078
sirreal wants to merge 9 commits intoWordPress:trunkfrom
sirreal:html-api/ignore-internal-methods-from-docs

Conversation

@sirreal
Copy link
Member

@sirreal sirreal commented Feb 27, 2026

The HTML API relies on many private and internal methods and classes. All of theme appear in the public documentation. This introduces a lot of noise into the documentation that's irrelevant for anyone not working directly on the HTML API itself.

By adding ignore annotations to most of the internal and private methods and classes, the documentation will be much cleaner and more relevant.

See the HTML processor class methods page for example. None of these internal methods should be of interest to folks using the HTML API:

Screenshot 2026-02-27 at 13 26 29

I have kept a few "internal" things documented, like the WP_HTML_Text_Replacement and WP_HTML_Span which are often useful for subclasses working with bookmarks and replacements.

* @access private
* @since 6.2.0
* @since 6.5.0 Replace `end` with `length` to more closely match `substr()`.
*
* @see WP_HTML_Tag_Processor
*/
class WP_HTML_Text_Replacement {

* @access private
* @since 6.2.0
* @since 6.5.0 Replaced `end` with `length` to more closely align with `substr()`.
*
* @see WP_HTML_Tag_Processor
*/
class WP_HTML_Span {

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


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.

@github-actions
Copy link

github-actions bot commented Feb 27, 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.

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

Props jonsurrell, westonruter.

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

@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

  • 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.

Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

Does the docs generator not ignore @access private symbols?

@sirreal
Copy link
Member Author

sirreal commented Mar 2, 2026

Does the docs generator not ignore @access private symbols?

No, it doesn't seem to. @ignore is used to hide things from public documentation.

@access private seems to add a notice to methods, but not to classes. I've created WordPress/phpdoc-parser#255 for this.

(I also noticed that private methods may include confusing recommendations from @see annotations).

@sirreal sirreal force-pushed the html-api/ignore-internal-methods-from-docs branch from 9f6fafc to 8a7deb6 Compare March 3, 2026 13:04
pento pushed a commit that referenced this pull request Mar 3, 2026
Add `@ignore` annotations to internal HTML API methods and classes to exclude them from generated documentation. The HTML API relies heavily on internal methods and classes and they create a lot of noise in documentation.

Developed in #11078.

Props jonsurrell, westonruter.
See #64224.


git-svn-id: https://develop.svn.wordpress.org/trunk@61793 602fd350-edb4-49c9-b593-d223f7449a82
@sirreal
Copy link
Member Author

sirreal commented Mar 3, 2026

Merged in r61793.

@sirreal sirreal closed this Mar 3, 2026
@sirreal sirreal deleted the html-api/ignore-internal-methods-from-docs branch March 3, 2026 13:12
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Mar 3, 2026
Add `@ignore` annotations to internal HTML API methods and classes to exclude them from generated documentation. The HTML API relies heavily on internal methods and classes and they create a lot of noise in documentation.

Developed in WordPress/wordpress-develop#11078.

Props jonsurrell, westonruter.
See #64224.

Built from https://develop.svn.wordpress.org/trunk@61793


git-svn-id: http://core.svn.wordpress.org/trunk@61099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants