wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
get_home_path › WordPress Function
Seit1.5.0
Veraltetn/v
› get_home_path ( Keine Parameter )
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: |
Gets the absolute filesystem path to the root of the WordPress installation.
Ähnliche Funktionen: get_home_template, get_theme_file_path, get_theme_data, get_theme_updates, get_home_url
Quellcode
function get_home_path() {
$home = set_url_scheme( get_option( 'home' ), 'http' );
$siteurl = set_url_scheme( get_option( 'siteurl' ), 'http' );
if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {
$wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */
$pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) );
$home_path = substr( $_SERVER['SCRIPT_FILENAME'], 0, $pos );
$home_path = trailingslashit( $home_path );
} else {
$home_path = ABSPATH;
}
return str_replace( '\\', '/', $home_path );
}