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