Switch language

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




url_shorten [ WordPress Function ]

url_shorten ( $url )
Parameters:
  • (string) $url
Returns:
  • (string)
Defined at:



Shorten an URL, to be used as link text

Source


<?php
function url_shorten$url ) {
    
$short_url str_replace'http://'''stripslashes$url ));
    
$short_url str_replace'www.'''$short_url );
    
$short_url untrailingslashit$short_url );
    if ( 
strlen$short_url ) > 35 )
        
$short_url substr$short_url032 ) . '...';
    return 
$short_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