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_password( 64, true, true );
}
} else {
$secret_keys = explode( "\n", wp_remote_retrieve_body( $secret_keys ) );
foreach ( $secret_keys as $k => $v ) {
$secret_keys[$k] = substr( $v, 28, 64 );
}
}
$key = 0;
foreach ( $config_file as &$line ) {
if ( '$table_prefix =' == substr( $line, 0, 16 ) ) {
$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 . "'" . addcslashes( constant( $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($line, ENT_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…" ); ?></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ý
- get_bloginfo - WordPress Codex
The get_bloginfo() function returns information about your site which can then be used elsewhere in your PHP code. This function, as well as bloginfo(), can also ...
codex.wordpress.org - get_bloginfo() second parameter, $filter ??? - WordPress
I understand that get_bloginfo is called first because another php function is being used on the returned string data, making the use of bloginfo impossible.
wordpress.org - wordpress.org - Are get_bloginfo queries cached to start, or should ...
Jul 15, 2011 ... I was just wondering if calling get_bloginfo too many times was going to harm performance in a theme and if the data should just be put into its ...
wordpress.stackexchange.com - Change WordPress get_bloginfo('url'); or permalink domain for posts ...
A WordPress site has recently changed from .co.uk to .org. As soon as ... Ok to start with Step 1: Open the theme folder you are using. Step 2: ...
stackoverflow.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- gregory.hk on "[Plugin: WordPress SEO by Yoast] changed get_bloginfo() to get_bloginfo_rss()"
- testingmoon on "Changed hosting providers... Lots of issues."
- netvision on "Changed hosting providers... Lots of issues."
- testingmoon on "Changed hosting providers... Lots of issues."
- netvision on "Changed hosting providers... Lots of issues."
- testingmoon on "Changed hosting providers... Lots of issues."
- MichaelH on "get_bloginfo or get_option"
- huggie on "get_bloginfo or get_option"
- MichaelH on "get_bloginfo or get_option"
- huggie on "get_bloginfo or get_option"