query_vars

query_vars

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

do_action('query_vars') is found 1 times:

  • /wp-includes/class-wp.php line 311
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    * @since 1.5.0
     *
     * @param string[] $public_query_vars The array of allowed query variable names.
     */
    $this->public_query_vars = apply_filters( 'query_vars', $this->public_query_vars );
     
    foreach ( get_post_types( array(), 'objects' ) as $post_type => $t ) {
        if ( is_post_type_viewable( $t ) && $t->query_var ) {
            $post_type_query_vars[ $t->query_var ] = $post_type;
        }
    }

See this hook used in plugins: