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