got_mod_rewrite example

<?php _e( 'Fill in the information below and you&#8217;ll be on your way to creating a network of WordPress sites. Configuration files will be created in the next step.' ); ?></p> <?php
    if ( isset( $_POST['subdomain_install'] ) ) {
        $subdomain_install = (bool) $_POST['subdomain_install'];
    } elseif ( apache_mod_loaded( 'mod_rewrite' ) ) { // Assume nothing.         $subdomain_install = true;
    } elseif ( ! allow_subdirectory_install() ) {
        $subdomain_install = true;
    } else {
        $subdomain_install = false;
        $got_mod_rewrite   = got_mod_rewrite();
        if ( $got_mod_rewrite ) { // Dangerous assumptions.             echo '<div class="updated inline"><p><strong>' . __( 'Note:' ) . '</strong> ';
            printf(
                /* translators: %s: mod_rewrite */
                __( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ),
                '<code>mod_rewrite</code>'
            );
            echo '</p>';
        } elseif ( $is_apache ) {
            echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> ';
            printf(
                

function got_url_rewrite() {
    $got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || iis7_supports_permalinks() );

    /** * Filters whether URL rewriting is available. * * @since 3.7.0 * * @param bool $got_url_rewrite Whether URL rewriting is available. */
    return apply_filters( 'got_url_rewrite', $got_url_rewrite );
}

$result['status']       = 'recommended';
        $result['description'] .= sprintf(
            '<p>%s</p>',
            __( 'If you are still seeing this warning after having tried the actions below, you may need to contact your hosting provider for further assistance.' )
        );

        if ( ! function_exists( 'got_mod_rewrite' ) ) {
            require_once ABSPATH . 'wp-admin/includes/misc.php';
        }

        if ( got_mod_rewrite() ) {
            $result['actions'] .= sprintf(
                '<p><a href="%s">%s</a></p>',
                esc_url( admin_url( 'options-permalink.php' ) ),
                __( 'Flush permalinks' )
            );
        } else {
            $result['actions'] .= sprintf(
                '<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
                __( 'https://developer.wordpress.org/rest-api/frequently-asked-questions/#why-is-authentication-not-working' ),
                __( 'Learn how to configure the Authorization header.' ),
                /* translators: Hidden accessibility text. */
                
Home | Imprint | This part of the site doesn't use cookies.