includes_url

Retrieves the URL to the includes directory.

Description

(string) includes_url( (string) $path = '', (null) $scheme = null ); 

Returns (string)

Includes URL link with optional path appended.

Parameters (2)

0. $path — Optional. (string) => ''
Path relative to the includes URL. Default empty.
1. $scheme — Optional. (null) => null
Scheme to give the includes URL context. Accepts http,, https., or relative. Default null.

Usage

  1. if ( !function_exists( 'includes_url' ) ) { 
  2. require_once ABSPATH . WPINC . '/link-template.php'; 
  3.  
  4. // Optional. Path relative to the includes URL. Default empty. 
  5. $path = ''; 
  6.  
  7. // Optional. Scheme to give the includes URL context. Accepts 
  8. // 'http', 'https', or 'relative'. Default null. 
  9. $scheme = null; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = includes_url($path, $scheme); 
  13.  

Defined (2)

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

/wp-includes/link-template.php  
  1. function includes_url( $path = '', $scheme = null ) { 
  2. $url = site_url( '/' . WPINC . '/', $scheme ); 
  3.  
  4. if ( $path && is_string( $path ) ) 
  5. $url .= ltrim($path, '/'); 
  6.  
  7. /** 
  8. * Filters the URL to the includes directory. 
  9. * @since 2.8.0 
  10. * @param string $url The complete URL to the includes directory including scheme and path. 
  11. * @param string $path Path relative to the URL to the wp-includes directory. Blank string 
  12. * if no path is specified. 
  13. */ 
  14. return apply_filters( 'includes_url', $url, $path ); 
/wp-admin/includes/noop.php  
  1. function includes_url() {}