allow_subdirectory_install() - WordPress 函数参考中文文档

返回介绍

allow_subdirectory_install()

发布于 2017-09-10 字数1765 浏览 1016 评论 0

allow_subdirectory_install()

Allow subdirectory install.


描述


返回值

(bool) Whether subdirectory install is allowed


源代码

File: wp-admin/includes/network.php

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;
}

更新日志

Version 描述
3.0.0 Introduced.

相关函数

Uses

  • wp-admin/includes/network.php:
    allow_subdirectory_install
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/wp-db.php:
    wpdb::get_row()

Used By

  • wp-admin/includes/network.php:
    network_step1()
  • wp-admin/includes/network.php:
    network_step2()

User Contributed Notes

上一篇:allowed_tags()

下一篇:allow_subdomain_install()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!