Switch language

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




wp_guess_url [ WordPress Function ]

wp_guess_url ( No parameters )
Returns:
  • (string)
Defined at:



Guess the URL for the site.

Will remove wp-admin links to retrieve only return URLs not in the wp-admin directory.

Source


<?php
function wp_guess_url() {
    if ( 
defined('WP_SITEURL') && '' != WP_SITEURL ) {
        
$url WP_SITEURL;
    } else {
        
$schema is_ssl() ? 'https://' 'http://';
        
$url preg_replace('#/(wp-admin/.*|wp-login.php)#i'''$schema $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    }
    return 
rtrim($url'/');
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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