Definition:
function get_home_path() {}
Get the absolute filesystem path to the root of the WordPress installation
Return values
returns:Full filesystem path to the root of the WordPress installation
Source code
function get_home_path() {
$home = get_option( 'home' );
$siteurl = get_option( 'siteurl' );
if ( $home != '' && $home != $siteurl ) {
$wp_path_rel_to_home = str_replace($home, '', $siteurl); /* $siteurl - $home */
$pos = strpos($_SERVER["SCRIPT_FILENAME"], $wp_path_rel_to_home);
$home_path = substr($_SERVER["SCRIPT_FILENAME"], 0, $pos);
$home_path = trailingslashit( $home_path );
} else {
$home_path = ABSPATH;
}
return $home_path;
}
1414

February 12, 2011 


No comments yet... Be the first to leave a reply!