Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_bloginfo [ WordPress Function ]

get_bloginfo ( No parameters )
Defined at:



No description yet.

Source


<?php
function get_bloginfo() {
            return ( ( 
is_ssl() ? 'https://' 'http://' ) . $_SERVER['HTTP_HOST'] . str_replace$_SERVER['PHP_SELF'], '/wp-admin/setup-config.php''' ) );
        }
        
/**#@-*/
        
$secret_keys wp_remote_get'https://api.wordpress.org/secret-key/1.1/salt/' );
    }

    if ( 
$no_api || is_wp_error$secret_keys ) ) {
        
$secret_keys = array();
        require_once( 
ABSPATH WPINC '/pluggable.php' );
        for ( 
$i 0$i 8$i++ ) {
            
$secret_keys[] = wp_generate_password64truetrue );
        }
    } else {
        
$secret_keys explode"\n"wp_remote_retrieve_body$secret_keys ) );
        foreach ( 
$secret_keys as $k => $v ) {
            
$secret_keys[$k] = substr$v2864 );
        }
    }

    
$key 0;
    foreach ( 
$config_file as &$line ) {
        if ( 
'$table_prefix  =' == substr$line016 ) ) {
            
$line '$table_prefix  = \'' addcslashes$prefix"\\'" ) . "';\r\n";
            continue;
        }

        if ( ! 
preg_match'/^define\(\'([A-Z_]+)\',([ ]+)/'$line$match ) )
            continue;

        
$constant $match[1];
        
$padding  $match[2];

        switch ( 
$constant ) {
            case 
'DB_NAME'     :
            case 
'DB_USER'     :
            case 
'DB_PASSWORD' :
            case 
'DB_HOST'     :
                
$line "define('" $constant "'," $padding "'" addcslashesconstant$constant ), "\\'" ) . "');\r\n";
                break;
            case 
'AUTH_KEY'         :
            case 
'SECURE_AUTH_KEY'  :
            case 
'LOGGED_IN_KEY'    :
            case 
'NONCE_KEY'        :
            case 
'AUTH_SALT'        :
            case 
'SECURE_AUTH_SALT' :
            case 
'LOGGED_IN_SALT'   :
            case 
'NONCE_SALT'       :
                
$line "define('" $constant "'," $padding "'" $secret_keys[$key++] . "');\r\n";
                break;
        }
    }
    unset( 
$line );

    if ( ! 
is_writable(ABSPATH) ) :
        
display_header();
?>
<p><?php _e"Sorry, but I can't write the <code>wp-config.php</code> file." ); ?></p>
<p><?php _e'You can create the <code>wp-config.php</code> manually and paste the following text into it.' ); ?></p>
<textarea cols="98" rows="15" class="code"><?php
        
foreach( $config_file as $line ) {
            echo 
htmlentities($lineENT_COMPAT'UTF-8');
        }
?></textarea>
<p><?php _e'After you\'ve done that, click "Run the install."' ); ?></p>
<p class="step"><a href="install.php" class="button"><?php _e'Run the install' ); ?></a></p>
<?php
    
else :
        
$handle fopen(ABSPATH 'wp-config.php''w');
        foreach( 
$config_file as $line ) {
            
fwrite($handle$line);
        }
        
fclose($handle);
        
chmod(ABSPATH 'wp-config.php'0666);
        
display_header();
?>
<p><?php _e"All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;" ); ?></p>

<p class="step"><a href="install.php" class="button"><?php _e'Run the install' ); ?></a></p>
<?php
    
endif;
    break;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics