Switch language

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




get_home_path [ WordPress Function ]

get_home_path ( No parameters )
Uses:
Returns:
  • (string) Full filesystem path to the root of the WordPress installation
Defined at:



Get the absolute filesystem path to the root of the WordPress installation

Source


<?php
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 strrpos($_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;
}
?>

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