Make WordPress Core


Ignore:
Timestamp:
02/14/2023 03:55:05 PM (20 months ago)
Author:
davidbaumwald
Message:

Themes: Use add_action for pre_get_posts hook in _add_template_loader_filters().

Although add_action and add_filter are internally the same, pre_get_posts is an action hook. This change updates the hook type to match what developers would expect when evaluating the code.

Follow-up to [52316].

Props swissspidy, riccardodicurti.
Fixes #57097.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-template.php

    r55318 r55335  
    2828    // Request to resolve a template.
    2929    if ( isset( $_GET['_wp-find-template'] ) ) {
    30         add_filter( 'pre_get_posts', '_resolve_template_for_new_post' );
     30        add_action( 'pre_get_posts', '_resolve_template_for_new_post' );
    3131    }
    3232}
Note: See TracChangeset for help on using the changeset viewer.