wp_plugin_directory_constants

The timeline below displays how wordpress function wp_plugin_directory_constants has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.4

/**
 * Defines plugin directory WordPress constants.
 *
 * Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
 *
 * @since 3.0.0
 */
function wp_plugin_directory_constants()
{
    if (!defined('WP_CONTENT_URL')) {
        define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
        // Full URL - WP_CONTENT_DIR is defined further up.
    }
    /**
     * Allows for the plugins directory to be moved from the default location.
     *
     * @since 2.6.0
     */
    if (!defined('WP_PLUGIN_DIR')) {
        define('WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins');
        // Full path, no trailing slash.
    }
    /**
     * Allows for the plugins directory to be moved from the default location.
     *
     * @since 2.6.0
     */
    if (!defined('WP_PLUGIN_URL')) {
        define('WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins');
        // Full URL, no trailing slash.
    }
    /**
     * Allows for the plugins directory to be moved from the default location.
     *
     * @since 2.1.0
     * @deprecated
     */
    if (!defined('PLUGINDIR')) {
        define('PLUGINDIR', 'wp-content/plugins');
        // Relative to ABSPATH. For back compat.
    }
    /**
     * Allows for the mu-plugins directory to be moved from the default location.
     *
     * @since 2.8.0
     */
    if (!defined('WPMU_PLUGIN_DIR')) {
        define('WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins');
        // Full path, no trailing slash.
    }
    /**
     * Allows for the mu-plugins directory to be moved from the default location.
     *
     * @since 2.8.0
     */
    if (!defined('WPMU_PLUGIN_URL')) {
        define('WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins');
        // Full URL, no trailing slash.
    }
    /**
     * Allows for the mu-plugins directory to be moved from the default location.
     *
     * @since 2.8.0
     * @deprecated
     */
    if (!defined('MUPLUGINDIR')) {
        define('MUPLUGINDIR', 'wp-content/mu-plugins');
        // Relative to ABSPATH. For back compat.
    }
}

WordPress Version: 5.1

/**
 * Defines plugin directory WordPress constants
 *
 * Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in
 *
 * @since 3.0.0
 */
function wp_plugin_directory_constants()
{
    if (!defined('WP_CONTENT_URL')) {
        define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
        // full url - WP_CONTENT_DIR is defined further up
    }
    /**
     * Allows for the plugins directory to be moved from the default location.
     *
     * @since 2.6.0
     */
    if (!defined('WP_PLUGIN_DIR')) {
        define('WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins');
        // full path, no trailing slash
    }
    /**
     * Allows for the plugins directory to be moved from the default location.
     *
     * @since 2.6.0
     */
    if (!defined('WP_PLUGIN_URL')) {
        define('WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins');
        // full url, no trailing slash
    }
    /**
     * Allows for the plugins directory to be moved from the default location.
     *
     * @since 2.1.0
     * @deprecated
     */
    if (!defined('PLUGINDIR')) {
        define('PLUGINDIR', 'wp-content/plugins');
        // Relative to ABSPATH. For back compat.
    }
    /**
     * Allows for the mu-plugins directory to be moved from the default location.
     *
     * @since 2.8.0
     */
    if (!defined('WPMU_PLUGIN_DIR')) {
        define('WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins');
        // full path, no trailing slash
    }
    /**
     * Allows for the mu-plugins directory to be moved from the default location.
     *
     * @since 2.8.0
     */
    if (!defined('WPMU_PLUGIN_URL')) {
        define('WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins');
        // full url, no trailing slash
    }
    /**
     * Allows for the mu-plugins directory to be moved from the default location.
     *
     * @since 2.8.0
     * @deprecated
     */
    if (!defined('MUPLUGINDIR')) {
        define('MUPLUGINDIR', 'wp-content/mu-plugins');
        // Relative to ABSPATH. For back compat.
    }
}

WordPress Version: 3.7

/**
 * Defines plugin directory WordPress constants
 *
 * Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in
 *
 * @since 3.0.0
 */
function wp_plugin_directory_constants()
{
    if (!defined('WP_CONTENT_URL')) {
        define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
    }
    // full url - WP_CONTENT_DIR is defined further up
    /**
     * Allows for the plugins directory to be moved from the default location.
     *
     * @since 2.6.0
     */
    if (!defined('WP_PLUGIN_DIR')) {
        define('WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins');
    }
    // full path, no trailing slash
    /**
     * Allows for the plugins directory to be moved from the default location.
     *
     * @since 2.6.0
     */
    if (!defined('WP_PLUGIN_URL')) {
        define('WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins');
    }
    // full url, no trailing slash
    /**
     * Allows for the plugins directory to be moved from the default location.
     *
     * @since 2.1.0
     * @deprecated
     */
    if (!defined('PLUGINDIR')) {
        define('PLUGINDIR', 'wp-content/plugins');
    }
    // Relative to ABSPATH. For back compat.
    /**
     * Allows for the mu-plugins directory to be moved from the default location.
     *
     * @since 2.8.0
     */
    if (!defined('WPMU_PLUGIN_DIR')) {
        define('WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins');
    }
    // full path, no trailing slash
    /**
     * Allows for the mu-plugins directory to be moved from the default location.
     *
     * @since 2.8.0
     */
    if (!defined('WPMU_PLUGIN_URL')) {
        define('WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins');
    }
    // full url, no trailing slash
    /**
     * Allows for the mu-plugins directory to be moved from the default location.
     *
     * @since 2.8.0
     * @deprecated
     */
    if (!defined('MUPLUGINDIR')) {
        define('MUPLUGINDIR', 'wp-content/mu-plugins');
    }
    // Relative to ABSPATH. For back compat.
}