Repository navigation
Docs: Replace incorrect @see usage with @link - #10804
huzaifaalmesbah wants to merge 25 commits into
Conversation
|
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. |
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. |
|
@huzaifaalmesbah Thanks for working on this cleanup! The conversion from @see to @link for external URLs is correct and follows the WordPress documentation standards. However, for better consistency within this PR, I suggest adding a brief description after each @link URL, similar to what was done in src/wp-includes/html-api/class-wp-html-decoder.php For example: * @link [URL] [Brief Description] This would make the documentation more descriptive and maintain a uniform style across all the modified files in this PR. |
|
I had wondered about this, but |
|
Thanks for pointing this out @westonruter ! However, according to the WordPress PHP Documentation Standards for DocBlocks: 👉 URLs should be added with the Specifically, the handbook states:
And:
So, while generic phpDocumentor allows linking URLs with Otherwise… I guess we might need to update the WordPress PHP Documentation Standards too 😄 |
|
Note there are merge conflicts. Also, if we are to make this change, should probably do it once every single occurrence. |
Comprehensive pass converting all `@see <url>` occurrences to `@link <url>` across WordPress core PHP, where @see was incorrectly used for URLs. Symbol references such as `@see Class::method()` are unchanged. Bundled external libraries (PHPMailer, SimplePie, PSR/Nyholm) are intentionally excluded.
The pomo/ directory is a bundled library, out of scope for this docs convention change. Restores the original @see in plural-forms.php.
|
Thanks for the review @westonruter ! Both points are now addressed:
|
The src/wp-includes/blocks/ directory is synced from Gutenberg packages and out of scope for core repo docs convention changes. Restores original @see tags to prevent build process failures.
# Conflicts: # src/wp-includes/global-styles-and-settings.php
|
@westonruter I merged the latest trunk into this branch and resolved the conflict in The remaining |
Converting `@see URL` to `@link URL` in place left the new `@link` tags ahead of the `@see` tags that followed them. The PHP documentation standards order `@see` before `@link`, so swap them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lker. The `html5_comment()` docblock linked to the developer.wordpress.org pages for core functions. Internal symbols are referenced with `@see function()`, which lets the documentation parser cross-link them, matching the existing `@see wp_list_comments()` in the same block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tag is only recognized at the start of a docblock line, so a list item reading `- @link URL` is plain text. Inside prose and lists, the inline `{@link URL}` form is the correct one, and it also restores the braces the original `- @see {URL}` items had. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Convert the `@see URL` references the earlier sweep missed: the inline prefetch script in `script-loader.php`, `pomo/plural-forms.php`, core JavaScript sources in `src/js`, and the PHPUnit tests and test helpers. The block render files in `src/wp-includes/blocks/` are left alone since they are synced from Gutenberg, and the normalize.css comment in Twenty Thirteen is left alone since it is vendored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Trac ticket URLs use `/ticket/<number>`, not `/tickets/<number>`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Requests library no longer has a `master` branch; the old URL only works through a redirect to `stable`, so link to `stable` directly. Also move the `@link` tag after `@since`, per the PHP documentation standards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The IE blog post moved from blogs.msdn.com to the Microsoft Learn archive, and the Chromium ViewVC revision link no longer resolves. Point to the archived post and to the Fetch Standard, which now defines the `X-Content-Type-Options` header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore the `@see` tag in `pomo/plural-forms.php`, which was converted despite the earlier decision to treat the pomo library as out of scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cription. The class description interleaves spec references with its paragraphs. As block-level tags, the first `@link` ended the description, and the paragraphs after it were parsed as the link's text. The inline form keeps the references in place without cutting the description short. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore the HTML API classes and their tests to match trunk. Their `@see` to `@link` changes now live in their own pull request, so the HTML API maintainers can review them separately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The WordPress inline documentation standards for PHP and JavaScript reserve `@see` for references to functions, methods, classes, and hooks, and use `@link` for URLs. While phpDocumentor and JSDoc both accept a URL in `@see`, core had used both forms for external references such as specifications, Trac tickets, and GitHub pull requests, so the remaining `@see` tags pointing to URLs are converted to `@link` across core, the bundled themes, core scripts, and the unit tests. On the touched lines, `@see` is kept ahead of `@link` where both appear, per the standards; links to developer.wordpress.org pages for core functions in Twenty Twenty become `@see` references to those functions; and links that no longer resolve are updated. The block files synced from Gutenberg, the bundled pomo library, and other third-party code are left unchanged, and the HTML API is handled separately. Developed in #10804. Follow-up to r63569. Props huzaifaalmesbah, westonruter, noruzzaman, shailu25. See #65860. git-svn-id: https://develop.svn.wordpress.org/trunk@64436 602fd350-edb4-49c9-b593-d223f7449a82
The WordPress inline documentation standards for PHP and JavaScript reserve `@see` for references to functions, methods, classes, and hooks, and use `@link` for URLs. While phpDocumentor and JSDoc both accept a URL in `@see`, core had used both forms for external references such as specifications, Trac tickets, and GitHub pull requests, so the remaining `@see` tags pointing to URLs are converted to `@link` across core, the bundled themes, core scripts, and the unit tests. On the touched lines, `@see` is kept ahead of `@link` where both appear, per the standards; links to developer.wordpress.org pages for core functions in Twenty Twenty become `@see` references to those functions; and links that no longer resolve are updated. The block files synced from Gutenberg, the bundled pomo library, and other third-party code are left unchanged, and the HTML API is handled separately. Developed in WordPress/wordpress-develop#10804. Follow-up to r63569. Props huzaifaalmesbah, westonruter, noruzzaman, shailu25. See #65860. Built from https://develop.svn.wordpress.org/trunk@64436 git-svn-id: http://core.svn.wordpress.org/trunk@63586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
✅ Committed in r64436 (8ce8797).
Trac Ticket: https://core.trac.wordpress.org/ticket/65860
Why this change?
This change aligns the codebase with the WordPress PHP Documentation Standards, which clearly distinguish between the intended usage of the
@seeand@linktags:@seeis meant for referencing internal structural elements of the WordPress codebase, such as classes, functions, methods, or hooks.@linkis meant for referencing external resources, including URLs, specifications, and tickets hosted outside the codebase.Currently, there are several instances in WordPress core where
@seeis incorrectly used to reference:This PR corrects those cases by replacing
@seewith@linkwhere the reference points to an external resource.Note that generic PHPDoc does allow a URI in
@see(phpDocumentor defines it as@see [URI | FQSEN]), so these usages are not invalid PHPDoc; they are non-standard under the WordPress PHP Documentation Standards, which reserve@seefor elements and@linkfor URLs. The same conversion was previously committed in r63569.When to use
@linkExternal URLs
Always use
@linkwhen referencing an external URLExample:
@link https://html.spec.whatwg.orgExternal resources
Use
@linkfor documentation, specifications, or tickets that live outside the WordPress codebaseContrast with
@seeUse
@seewhen referring to:@see wp_remote_get())@see WP_Query)Detailed changes
Every
@seetag that pointed to a URL is converted to@link, across 34 files insrc/wp-includes,src/wp-load.php,src/js/_enqueues, the Twenty Fifteen and Twenty Twenty themes, andtests/phpunit.The HTML API changes (
src/wp-includes/html-api/and its tests) have been split out into #14370 for review by the HTML API maintainers.Related cleanups:
@linkended up above an@seetag, the two are swapped so@seecomes first, per the documentation standards.@see function_name()references./tickets/42957path inpluggable.phpanduser.php, the Requests hooks docs URL (master→stable), and the dead MSDN and Chromium links onsend_nosniff_header().Out of scope and left unchanged:
src/wp-includes/blocks/, which is synced from Gutenberg.src/wp-includes/pomo/, which is a bundled library.style.css.