Skip to content

Hooks/Docs: Missing PHPDoc on active hooks — pre_option_enable_xmlrpc, option_enable_xmlrpc, show_recent_comments_widget_style, enqueue_block_assets (secondary), build page init hooks #28

Closed as not planned

Description

@apermo

Summary

6 active (non-deprecated) hook calls are missing PHPDoc. These are the genuinely actionable items from the missing-PHPDoc audit.


wp-includes/class-wp-xmlrpc-server.php — Back-compat filters (2)

pre_option_enable_xmlrpc and option_enable_xmlrpc are back-compat filters left for plugins that used to hook get_option('enable_xmlrpc') before the option was removed in 3.5.0. They have no PHPDoc at all.

https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-includes/class-wp-xmlrpc-server.php#L194-L196

$is_enabled = apply_filters( 'pre_option_enable_xmlrpc', false );
if ( false === $is_enabled ) {
    $is_enabled = apply_filters( 'option_enable_xmlrpc', true );
}

Both need a PHPDoc with @since, @deprecated (or a note to use xmlrpc_enabled instead), and @param / @return.


wp-includes/widgets/class-wp-widget-recent-comments.php — Filter (1)

show_recent_comments_widget_style has no PHPDoc. The filter controls whether the Recent Comments widget injects its inline <style> block.

https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php#L54

if ( ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) {

Needs a full PHPDoc: @since, @param bool $show, @param string $id_base.


wp-includes/block-editor.php — Secondary call needing cross-reference (1)

enqueue_block_assets is called a second time in wp_add_iframed_editor_assets_html() without any comment. The primary PHPDoc lives in wp-includes/script-loader.php.

https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-includes/block-editor.php#L341

Primary documentation:
https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-includes/script-loader.php#L2511-L2517

Fix: replace the bare call with /** This action is documented in wp-includes/script-loader.php */.


wp-includes/build/pages — Init actions (6)

Six build-page scaffolding files each fire an _init action with no PHPDoc. These are new hooks introduced with the build-pages architecture and have no documentation anywhere.

https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-includes/build/pages/font-library/page.php#L138
https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-includes/build/pages/font-library/page-wp-admin.php#L138
https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-includes/build/pages/options-connectors/page.php#L138
https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-includes/build/pages/options-connectors/page-wp-admin.php#L138
https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-includes/build/pages/site-editor-v2/page.php#L138
https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-includes/build/pages/site-editor-v2/page-wp-admin.php#L138

do_action( 'font-library_init' );
do_action( 'font-library-wp-admin_init' );
do_action( 'options-connectors_init' );
// etc.

Each needs a PHPDoc explaining when the hook fires and what it is for. These are the most impactful of the group — public hooks for page initialization with no documentation.

Note: these files may be generated/templated — worth confirming with Weston whether the source of truth is elsewhere before adding PHPDoc directly.

Activity

  1. added this to the Missing PHPDoc milestone on Mar 8, 2026
  2. apermo commented on Mar 8, 2026

    @apermo
    OwnerAuthor

    Cross-reference analysis

    False positive — already has PHPDoc:

    • show_recent_comments_widget_style — already has a complete PHPDoc block at class-wp-widget-recent-comments.php:45-52 with @since 3.1.0, @param bool, @param string. No action needed. Removing from this issue's scope.

    Needs xref (canonical PHPDoc exists):

    • enqueue_block_assets in block-editor.php:341 — canonical PHPDoc in script-loader.php:2509-2516. Needs /** This action is documented in wp-includes/script-loader.php */.

    Needs own PHPDoc:

    • pre_option_enable_xmlrpc, option_enable_xmlrpc — single occurrence each in class-wp-xmlrpc-server.php. Back-compat filters, need PHPDoc with note about xmlrpc_enabled filter.
    • Build page init hooks (6 occurrences) — font-library_init, font-library-wp-admin_init, options-connectors_init, options-connectors-wp-admin_init, site-editor-v2_init, site-editor-v2-wp-admin_init. These files are likely generated/templated — needs confirmation before adding PHPDoc directly.
  3. apermo commented on Mar 8, 2026

    @apermo
    OwnerAuthor

    No action needed — all items resolved or false positives: xmlrpc filters are deprecated back-compat, show_recent_comments_widget_style already has PHPDoc, enqueue_block_assets fixed in PR WordPress#11205 (#36), build page files don't exist in the repo.

  4. added
    wontfixAcknowledged but not worth the review effort
    on Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixAcknowledged but not worth the review effort

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions