wp_plugin_directory_constants

Defines plugin directory WordPress constants.

Description

wp_plugin_directory_constants(); 

Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in


Usage

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

Defined (1)

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

/wp-includes/default-constants.php  
  1. function wp_plugin_directory_constants() { 
  2. if ( !defined('WP_CONTENT_URL') ) 
  3. define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up 
  4.  
  5. /** 
  6. * Allows for the plugins directory to be moved from the default location. 
  7. * @since 2.6.0 
  8. */ 
  9. if ( !defined('WP_PLUGIN_DIR') ) 
  10. define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash 
  11.  
  12. /** 
  13. * Allows for the plugins directory to be moved from the default location. 
  14. * @since 2.6.0 
  15. */ 
  16. if ( !defined('WP_PLUGIN_URL') ) 
  17. define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash 
  18.  
  19. /** 
  20. * Allows for the plugins directory to be moved from the default location. 
  21. * @since 2.1.0 
  22. * @deprecated 
  23. */ 
  24. if ( !defined('PLUGINDIR') ) 
  25. define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. 
  26.  
  27. /** 
  28. * Allows for the mu-plugins directory to be moved from the default location. 
  29. * @since 2.8.0 
  30. */ 
  31. if ( !defined('WPMU_PLUGIN_DIR') ) 
  32. define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash 
  33.  
  34. /** 
  35. * Allows for the mu-plugins directory to be moved from the default location. 
  36. * @since 2.8.0 
  37. */ 
  38. if ( !defined('WPMU_PLUGIN_URL') ) 
  39. define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash 
  40.  
  41. /** 
  42. * Allows for the mu-plugins directory to be moved from the default location. 
  43. * @since 2.8.0 
  44. * @deprecated 
  45. */ 
  46. if ( !defined( 'MUPLUGINDIR' ) ) 
  47. define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat.