Ticket #21412: dropins.php
File dropins.php, 435 bytes (added by , 12 years ago) |
---|
Line | |
---|---|
1 | <?php |
2 | |
3 | function 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 | } |