Make WordPress Core

Ticket #21412: dropins.php

File dropins.php, 435 bytes (added by mikeschinkel, 14 years ago)

dropins.php - To enable loading .php files from /wp-content/dropins/

Line 
1<?php
2
3function wp_load_dropins() {
4 global $wp_dropins;
5 $wp_dropins = array();
6 define( 'WP_DROPINS_DIR', WP_CONTENT_DIR . '/dropins' );
7 if ( ! is_dir( WP_DROPINS_DIR ) )
8 return;
9 if ( ! $dh = opendir( WP_DROPINS_DIR ) )
10 return;
11 while ( ( $dropin = readdir( $dh ) ) !== false ) {
12 if ( substr( $dropin, -4 ) == '.php' )
13 include( $wp_dropins[] = WP_DROPINS_DIR . '/' . $dropin );
14 }
15 closedir( $dh );
16 return $wp_dropins;
17}