_make_web_ftp_clickable_cb [ WordPress Function ]
_make_web_ftp_clickable_cb ( $matches )
| Access: |
|
| Parameters: |
|
| Returns: |
|
| 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_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
$ret = substr($dest, -1);
$dest = substr($dest, 0, strlen($dest)-1);
}
return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- _make_web_ftp_clickable_cb() WordPress function reference ...
Callback to convert URL match to HTML A element.
queryposts.com - php - How do I call a function within the same class as a callback of ...
+]+)#is', '_make_web_ftp_clickable_cb', $ret); $ret ... $suffix; } } function _make_web_ftp_clickable_cb($matches) { $ret = ''; $dest ...
stackoverflow.com - November | 2010 | sam j levy
Nov 14, 2010 ... return $matches[1] . "<a href=\"$url\" rel=\"nofollow\" target=\"_blank\">$url</a>" . $ret;. } function _make_web_ftp_clickable_cb($matches) { ...
samjlevy.com - using wordpress function make_clickable() to convert urls in a string ...
$ret; } function _make_web_ftp_clickable_cb($matches) { $ret = ''; $dest = $ matches[2]; $dest = 'http://' . $dest; if ( empty($dest) ) return $matches[0]; // removed ...
forrst.com