Make WordPress Core

Changeset 57595


Ignore:
Timestamp:
02/12/2024 03:24:02 PM (7 months ago)
Author:
audrasjb
Message:

Canonical: Introduce admin_canonical_url filter.

This changeset introduces the new admin_canonical_url hook to help developers and extenders to modify the admin canonical url value.

Props prionkor, audrasjb.
Fixes #59545.

File:
1 edited

Legend:

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

    r57572 r57595  
    13971397    $current_url  = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
    13981398    $filtered_url = remove_query_arg( $removable_query_args, $current_url );
     1399
     1400    /**
     1401     * Filters the admin canonical url value.
     1402     *
     1403     * @since 6.5.0
     1404     *
     1405     * @param string $filtered_url The admin canonical url value.
     1406     */
     1407    $filtered_url = apply_filters( 'admin_canonical_url', $filtered_url );
    13991408    ?>
    14001409    <link id="wp-admin-canonical" rel="canonical" href="<?php echo esc_url( $filtered_url ); ?>" />
Note: See TracChangeset for help on using the changeset viewer.