Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_resource_hints

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
2852
2853           /**
2854            * Filters domains and URLs for resource hints of relation type.
2855            *
2856            * @since 4.6.0
2857            *
2858            * @param array  $urls          URLs to print for resource hints.
2859            * @param string $relation_type The relation type the URLs are printed for, e.g. 'preconnect' or 'prerender'.
2860            */
2861           $urls = apply_filters( 'wp_resource_hints', $urls, $relation_type );
2862
2863           foreach ( $urls as $key => $url ) {
2864                $atts = array();
2865
2866                if ( is_array( $url ) ) {
2867                     if ( isset( $url['href'] ) ) {
2868                          $atts = $url;
2869                          $url  = $url['href'];
2870                     } else {