函数原型
allow_subdirectory_install(): bool
函数描述
Allow subdirectory installation.
是否弃用
未弃用
函数参数
无
函数返回值
bool Whether subdirectory installation is allowed
函数位置
File: wp-admin/includes/network.php.
函数源码
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;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

