Used By
Used By | Description |
---|---|
wp-admin/includes/plugin-install.php: install_plugin_information() | Display plugin information in dialog box form. |
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.
(string) (Required) String to search for links in.
(string) (Required) The base URL to prefix to links.
(array) (Optional) The attributes which should be processed.
Default value: array('src', 'href')
(string) The processed content.
File: wp-includes/formatting.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 ); }
Version | Description |
---|---|
2.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/links_add_base_url