Switch language

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




_links_add_base [ WordPress Function ]

_links_add_base ( $m )
Access:
  • private
Parameters:
  • (string) $m The matched link.
Returns:
  • (string) The processed link.
Defined at:



Callback to add a base url to relative links in passed content.

Source


<?php
function _links_add_base($m) {
    global 
$_links_add_base;
    
//1 = attribute name  2 = quotation mark  3 = URL
    
return $m[1] . '=' $m[2] .
        ( 
preg_match'#^(\w{1,20}):#'$m[3], $protocol ) && in_array$protocol[1], wp_allowed_protocols() ) ?
            
$m[3] :
            
path_join$_links_add_base$m[3] ) )
        . 
$m[2];
}
?>

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