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
3767       *         @type string $crossorigin   Indicates the CORS policy of the specified resource.
3768       *         @type string $type          Type of the resource (`text/html`, `text/css`, etc).
3769       *         @type string $media         Accepts media types or media queries. Allows responsive preloading.
3770       *         @type string $imagesizes    Responsive source size to the source Set.
3771       *         @type string $imagesrcset   Responsive image sources to the source set.
3772       *         @type string $fetchpriority Fetchpriority value for the resource.
3773       *     }
3774       * }
3775       */
3776      $preload_resources = apply_filters( 'wp_preload_resources', array() );
3777
3778      if ( ! is_array( $preload_resources ) ) {
3779           return;
3780      }
3781
3782      $unique_resources = array();
3783
3784      // Parse the complete resource list and extract unique resources.
3785      foreach ( $preload_resources as $resource ) {