close

Make WordPress Core

Changeset 61866


Ignore:
Timestamp:
03/08/2026 11:47:58 PM (5 days ago)
Author:
SergeyBiryukov
Message:

Code Quality: Correct hook registration type mismatches.

Though add_action() and add_filter() are functionally equivalent internally, for proper semantics the former should be used on actions and the latter on filters.

Follow-up to [37920], [38046], [53266].

Props apermo.
Fixes #64828.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/admin-filters.php

    r61030 r61866  
    5454// Prerendering.
    5555if ( ! is_customize_preview() ) {
    56     add_filter( 'admin_print_styles', 'wp_resource_hints', 1 );
     56    add_action( 'admin_print_styles', 'wp_resource_hints', 1 );
    5757}
    5858
     
    8686add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );
    8787
    88 add_action( 'use_block_editor_for_post_type', '_disable_block_editor_for_navigation_post_type', 10, 2 );
     88add_filter( 'use_block_editor_for_post_type', '_disable_block_editor_for_navigation_post_type', 10, 2 );
    8989add_action( 'edit_form_after_title', '_disable_content_editor_for_navigation_post_type' );
    9090add_action( 'edit_form_after_editor', '_enable_content_editor_for_navigation_post_type' );
  • trunk/src/wp-includes/default-filters.php

    r61833 r61866  
    386386// Login actions.
    387387add_action( 'login_head', 'wp_robots', 1 );
    388 add_filter( 'login_head', 'wp_resource_hints', 8 );
     388add_action( 'login_head', 'wp_resource_hints', 8 );
    389389add_action( 'login_head', 'wp_print_head_scripts', 9 );
    390390add_action( 'login_head', 'print_admin_styles', 9 );
Note: See TracChangeset for help on using the changeset viewer.