Switch language

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




links_add_base_url [ WordPress Function ]

links_add_base_url ( $content, $base, $attrs = array('src', 'href') )
Parameters:
  • (string) $content String to search for links in.
  • (string) $base The base URL to prefix to links.
  • (array) $attrs The attributes which should be processed.
Returns:
  • (string) The processed content.
Defined at:



Add a Base url to relative links in passed content.

By default it supports the 'src' and 'href' attributes. However this can be changed via the 3rd param.

Source


<?php
function links_add_base_url$content$base$attrs = array('src''href') ) {
    global 
$_links_add_base;
    
$_links_add_base $base;
    
$attrs implode('|', (array)$attrs);
    return 
preg_replace_callback"!($attrs)=(['\"])(.+?)\\2!i"'_links_add_base'$content );
}
?>

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