Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_admin_canonical_url

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1399      $filtered_url = remove_query_arg( $removable_query_args, $current_url );
1400
1401      /**
1402       * Filters the admin canonical url value.
1403       *
1404       * @since 6.5.0
1405       *
1406       * @param string $filtered_url The admin canonical url value.
1407       */
1408      $filtered_url = apply_filters( 'wp_admin_canonical_url', $filtered_url );
1409      ?>
1410      <link id="wp-admin-canonical" rel="canonical" href="<?php echo esc_url( $filtered_url ); ?>" />
1411      <script>
1412           if ( window.history.replaceState ) {
1413                window.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash );
1414           }
1415      </script>
1416      <?php
1417 }