Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_preload_resources

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
3603       *                                   (`script`, `style`, `image`, `document`, etc).
3604       *         @type string $crossorigin Indicates the CORS policy of the specified resource.
3605       *         @type string $type        Type of the resource (`text/html`, `text/css`, etc).
3606       *         @type string $media       Accepts media types or media queries. Allows responsive preloading.
3607       *         @type string $imagesizes  Responsive source size to the source Set.
3608       *         @type string $imagesrcset Responsive image sources to the source set.
3609       *     }
3610       * }
3611       */
3612      $preload_resources = apply_filters( 'wp_preload_resources', array() );
3613
3614      if ( ! is_array( $preload_resources ) ) {
3615           return;
3616      }
3617
3618      $unique_resources = array();
3619
3620      // Parse the complete resource list and extract unique resources.
3621      foreach ( $preload_resources as $resource ) {