validate_plugin_requirements example

$current             = get_site_option( 'active_sitewide_plugins', array() );
        $_GET['networkwide'] = 1; // Back compat for plugins looking for this value.     } else {
        $current = get_option( 'active_plugins', array() );
    }

    $valid = validate_plugin( $plugin );
    if ( is_wp_error( $valid ) ) {
        return $valid;
    }

    $requirements = validate_plugin_requirements( $plugin );
    if ( is_wp_error( $requirements ) ) {
        return $requirements;
    }

    if ( $network_wide && ! isset( $current[ $plugin ] )
        || ! $network_wide && ! in_array( $plugin$current, true )
    ) {
        if ( ! empty( $redirect ) ) {
            // We'll override this later if the plugin can be included without fatal error.             wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin )$redirect ) );
        }

        
Home | Imprint | This part of the site doesn't use cookies.