_get_dropins example

'label' => __( 'Total installation size' ),
                    'value' => $loading,
                    'debug' => 'loading...',
                ),
            );
        }

        // Get a list of all drop-in replacements.         $dropins = get_dropins();

        // Get dropins descriptions.         $dropin_descriptions = _get_dropins();

        // Spare few function calls.         $not_available = __( 'Not available' );

        foreach ( $dropins as $dropin_key => $dropin ) {
            $info['wp-dropins']['fields'][ sanitize_text_field( $dropin_key ) ] = array(
                'label' => $dropin_key,
                'value' => $dropin_descriptions[ $dropin_key ][0],
                'debug' => 'true',
            );
        }

        
/** * Checks the wp-content directory and retrieve all drop-ins with any plugin data. * * @since 3.0.0 * @return array[] Array of arrays of dropin plugin data, keyed by plugin file name. See get_plugin_data(). */
function get_dropins() {
    $dropins      = array();
    $plugin_files = array();

    $_dropins = _get_dropins();

    // Files in wp-content directory.     $plugins_dir = @opendir( WP_CONTENT_DIR );
    if ( $plugins_dir ) {
        while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
            if ( isset( $_dropins[ $file ] ) ) {
                $plugin_files[] = $file;
            }
        }
    } else {
        return $dropins;
    }
$restrict_network_only   = false;

        $requires_php = isset( $plugin_data['RequiresPHP'] ) ? $plugin_data['RequiresPHP'] : null;
        $requires_wp  = isset( $plugin_data['RequiresWP'] ) ? $plugin_data['RequiresWP'] : null;

        $compatible_php = is_php_version_compatible( $requires_php );
        $compatible_wp  = is_wp_version_compatible( $requires_wp );

        if ( 'mustuse' === $context ) {
            $is_active = true;
        } elseif ( 'dropins' === $context ) {
            $dropins     = _get_dropins();
            $plugin_name = $plugin_file;

            if ( $plugin_file !== $plugin_data['Name'] ) {
                $plugin_name .= '<br />' . $plugin_data['Name'];
            }

            if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant.                 $is_active   = true;
                $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
            } elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true.                 $is_active   = true;
                
Home | Imprint | This part of the site doesn't use cookies.