allow_subdirectory_install

Allow subdirectory install.

Description

allow_subdirectory_install(); 

Usage

  1. if ( !function_exists( 'allow_subdirectory_install' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/network.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = allow_subdirectory_install(); 
  7.  

Defined (1)

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

/wp-admin/includes/network.php  
  1. function allow_subdirectory_install() { 
  2. global $wpdb; 
  3. /** 
  4. * Filter whether to enable the subdirectory install feature in Multisite. 
  5. * @since 3.0.0 
  6. * @param bool $allow Whether to enable the subdirectory install feature in Multisite. Default is false. 
  7. */ 
  8. return true; 
  9.  
  10. if ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL ) 
  11. return true; 
  12.  
  13. $post = $wpdb->get_row( "SELECT ID FROM $wpdb->posts WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'" ); 
  14. if ( empty( $post ) ) 
  15. return true; 
  16.  
  17. return false;