allow_subdirectory_install

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

WordPress Version: 5.5

/**
 * Allow subdirectory installation.
 *
 * @since 3.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether subdirectory installation is allowed
 */
function allow_subdirectory_install()
{
    global $wpdb;
    /**
     * Filters whether to enable the subdirectory installation feature in Multisite.
     *
     * @since 3.0.0
     *
     * @param bool $allow Whether to enable the subdirectory installation feature in Multisite.
     *                    Default false.
     */
    if (apply_filters('allow_subdirectory_install', false)) {
        return true;
    }
    if (defined('ALLOW_SUBDIRECTORY_INSTALL') && ALLOW_SUBDIRECTORY_INSTALL) {
        return true;
    }
    $post = $wpdb->get_row("SELECT ID FROM {$wpdb->posts} WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'");
    if (empty($post)) {
        return true;
    }
    return false;
}

WordPress Version: 4.9

/**
 * Allow subdirectory installation.
 *
 * @since 3.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether subdirectory installation is allowed
 */
function allow_subdirectory_install()
{
    global $wpdb;
    /**
     * Filters whether to enable the subdirectory installation feature in Multisite.
     *
     * @since 3.0.0
     *
     * @param bool $allow Whether to enable the subdirectory installation feature in Multisite. Default is false.
     */
    if (apply_filters('allow_subdirectory_install', false)) {
        return true;
    }
    if (defined('ALLOW_SUBDIRECTORY_INSTALL') && ALLOW_SUBDIRECTORY_INSTALL) {
        return true;
    }
    $post = $wpdb->get_row("SELECT ID FROM {$wpdb->posts} WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'");
    if (empty($post)) {
        return true;
    }
    return false;
}

WordPress Version: 4.6

/**
 * Allow subdirectory install.
 *
 * @since 3.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether subdirectory install is allowed
 */
function allow_subdirectory_install()
{
    global $wpdb;
    /**
     * Filters whether to enable the subdirectory install feature in Multisite.
     *
     * @since 3.0.0
     *
     * @param bool $allow Whether to enable the subdirectory install feature in Multisite. Default is false.
     */
    if (apply_filters('allow_subdirectory_install', false)) {
        return true;
    }
    if (defined('ALLOW_SUBDIRECTORY_INSTALL') && ALLOW_SUBDIRECTORY_INSTALL) {
        return true;
    }
    $post = $wpdb->get_row("SELECT ID FROM {$wpdb->posts} WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'");
    if (empty($post)) {
        return true;
    }
    return false;
}

WordPress Version: 4.5

/**
 * Allow subdirectory install.
 *
 * @since 3.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether subdirectory install is allowed
 */
function allow_subdirectory_install()
{
    global $wpdb;
    /**
     * Filter whether to enable the subdirectory install feature in Multisite.
     *
     * @since 3.0.0
     *
     * @param bool $allow Whether to enable the subdirectory install feature in Multisite. Default is false.
     */
    if (apply_filters('allow_subdirectory_install', false)) {
        return true;
    }
    if (defined('ALLOW_SUBDIRECTORY_INSTALL') && ALLOW_SUBDIRECTORY_INSTALL) {
        return true;
    }
    $post = $wpdb->get_row("SELECT ID FROM {$wpdb->posts} WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'");
    if (empty($post)) {
        return true;
    }
    return false;
}

WordPress Version: 4.4

/**
 * Allow subdirectory install.
 *
 * @since 3.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether subdirectory install is allowed
 */
function allow_subdirectory_install()
{
    global $wpdb;
    /**
     * Filter whether to enable the subdirectory install feature in Multisite.
     *
     * @since 3.0.0
     *
     * @param bool true Whether to enable the subdirectory install feature in Multisite. Default is false.
     */
    if (apply_filters('allow_subdirectory_install', false)) {
        return true;
    }
    if (defined('ALLOW_SUBDIRECTORY_INSTALL') && ALLOW_SUBDIRECTORY_INSTALL) {
        return true;
    }
    $post = $wpdb->get_row("SELECT ID FROM {$wpdb->posts} WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'");
    if (empty($post)) {
        return true;
    }
    return false;
}

WordPress Version: 4.3

/**
 * Allow subdirectory install.
 *
 * @since 3.0.0
 *
 * @global wpdb $wpdb
 *
 * @return bool Whether subdirectory install is allowed
 */
function allow_subdirectory_install()
{
    global $wpdb;
    /**
     * Filter whether to enable the subdirectory install feature in Multisite.
     *
     * @since 3.0.0
     *
     * @param bool true Whether to enable the subdirectory install feature in Multisite. Default is false.
     */
    if (apply_filters('allow_subdirectory_install', false)) {
        return true;
    }
    if (defined('ALLOW_SUBDIRECTORY_INSTALL') && ALLOW_SUBDIRECTORY_INSTALL) {
        return true;
    }
    $post = $wpdb->get_row("SELECT ID FROM {$wpdb->posts} WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'");
    if (empty($post)) {
        return true;
    }
    return false;
}

WordPress Version: 3.7

/**
 * Allow subdirectory install.
 *
 * @since 3.0.0
 * @return bool Whether subdirectory install is allowed
 */
function allow_subdirectory_install()
{
    global $wpdb;
    /**
     * Filter whether to enable the subdirectory install feature in Multisite.
     *
     * @since 3.0.0
     *
     * @param bool true Whether to enable the subdirectory install feature in Multisite. Default is false.
     */
    if (apply_filters('allow_subdirectory_install', false)) {
        return true;
    }
    if (defined('ALLOW_SUBDIRECTORY_INSTALL') && ALLOW_SUBDIRECTORY_INSTALL) {
        return true;
    }
    $post = $wpdb->get_row("SELECT ID FROM {$wpdb->posts} WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'");
    if (empty($post)) {
        return true;
    }
    return false;
}