wpseek.com
A WordPress-centric search engine for devs and theme authors
_make_web_ftp_clickable_cb is private and should not be used in themes or plugins directly.
_make_web_ftp_clickable_cb › WordPress Function
Since2.3.2
Deprecatedn/a
› _make_web_ftp_clickable_cb ( $matches )
Access: |
|
Parameters: |
|
Returns: |
|
Defined at: |
|
Codex: |
Callback to convert URL match to HTML A element.
This function was backported from 2.5.0 to 2.3.2. Regex callback for make_clickable().Related Functions: _make_email_clickable_cb, _make_url_clickable_cb, make_clickable, _make_clickable_rel_attr, wp_make_theme_file_tree
Source
function _make_web_ftp_clickable_cb( $matches ) { $ret = ''; $dest = $matches[2]; $dest = 'http://' . $dest; // Removed trailing [.,;:)] from URL. $last_char = substr( $dest, -1 ); if ( in_array( $last_char, array( '.', ',', ';', ':', ')' ), true ) === true ) { $ret = $last_char; $dest = substr( $dest, 0, strlen( $dest ) - 1 ); } $dest = esc_url( $dest ); if ( empty( $dest ) ) { return $matches[0]; } $rel_attr = _make_clickable_rel_attr( $dest ); return $matches[1] . "<a href=\"{$dest}\"{$rel_attr}>{$dest}</a>{$ret}"; }