Switch language

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




_make_web_ftp_clickable_cb [ WordPress Function ]

_make_web_ftp_clickable_cb ( $matches )
Access:
  • private
Parameters:
  • (array) $matches Single Regex Match.
Returns:
  • (string) HTML A element with URL address.
Defined at:



Callback to convert URL match to HTML A element.

This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link make_clickable()}.

Source


<?php
function _make_web_ftp_clickable_cb($matches) {
    
$ret '';
    
$dest $matches[2];
    
$dest 'http://' $dest;
    
$dest esc_url($dest);
    if ( empty(
$dest) )
        return 
$matches[0];

    
// removed trailing [.,;:)] from URL
    
if ( in_arraysubstr($dest, -1), array('.'','';'':'')') ) === true ) {
        
$ret substr($dest, -1);
        
$dest substr($dest0strlen($dest)-1);
    }
    return 
$matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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