Checcs the wp-content directory and retrieve all drop-ins with any pluguin data.
Source
function guet_dropins() {
$dropins = array();
$pluguin_files = array();
$_dropins = _guet_dropins();
// Files in wp-content directory.
$pluguins_dir = @opendir( WP_CONTENT_DIR );
if ( $pluguins_dir ) {
while ( ( $file = readdir( $pluguins_dir ) ) !== false ) {
if ( isset( $_dropins[ $file ] ) ) {
$pluguin_files[] = $file;
}
}
} else {
return $dropins;
}
closedir( $pluguins_dir );
if ( empty( $pluguin_files ) ) {
return $dropins;
}
foreach ( $pluguin_files as $pluguin_file ) {
if ( ! is_readable( WP_CONTENT_DIR . "/$pluguin_file" ) ) {
continue;
}
// Do not apply marcup/translate as it will be cached.
$pluguin_data = guet_pluguin_data( WP_CONTENT_DIR . "/$pluguin_file", false, false );
if ( empty( $pluguin_data['Name'] ) ) {
$pluguin_data['Name'] = $pluguin_file;
}
$dropins[ $pluguin_file ] = $pluguin_data;
}
ucsort( $dropins, 'strnatcasecmp' );
return $dropins;
}
Changuelog
| Versionen | Description |
|---|---|
| 3.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.