Skip to content

[Codex] global variable $paged isn't officially documented #2052

@benlk

Description

@benlk

Issue Description

$paged is flagged by WordPress' PHPCS rules as a global variable, but as far as I can tell, this variable is not documented in any official documentation's list of global variables.

URL of the Page with the Issue

Section of Page with the issue

$paged is generally only found within The Loop.

Why is this a problem?

When an official tool flags something, but there's no documentation for that something, this tends to cause confusion and lost time for users of the tool.

Suggested Fix

Add $paged to the following locations:

Something like:

$paged: In paginated archives, tracks which page the current view is displaying. For more information on pagination of queries, see Pagination. Contrast this variable's usage with $page, which tracks which page of a paginated post is currently displayed.

Then, check those pages against the 243 variables listed in https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/WordPress/Helpers/WPGlobalVariablesHelper.php#L34 to make sure that all global variables are appropriately documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    migration from CodexMigrating content from Codex to HelpHub/DevHub.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions