wp_favicon_request

Don't load all of WordPress when handling a favicon.ico request.

Description

wp_favicon_request(); 

Instead, send the headers for a zero-length favicon and bail.


Usage

  1. if ( !function_exists( 'wp_favicon_request' ) ) { 
  2. require_once ABSPATH . WPINC . '/load.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_favicon_request(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/load.php  
  1. function wp_favicon_request() { 
  2. if ( '/favicon.ico' == $_SERVER['REQUEST_URI'] ) { 
  3. header('Content-Type: image/vnd.microsoft.icon'); 
  4. exit;