function _filter_url
Same name and namespace in other branches
- 10 core/modules/filter/filter.module \_filter_url()
- 9 core/modules/filter/filter.module \_filter_url()
- 8.9.x core/modules/filter/filter.module \_filter_url()
- 7.x modules/filter/filter.module \_filter_url()
- main core/modules/filter/filter.module \_filter_url()
Converts text into hyperlinks automatically.
This filter identifies and makes clickable three types of "links".
- URLs like http://example.com.
- Email addresses like name@example.com.
- Web addresses without the "http://" protocol defined, like www.example.com.
Each type must be processed separately, as there is no one regular expression that could possibly match all of the cases in one pass.
Deprecated
in drupal:11.4.0 and is removed from drupal:13.0.0. The logic has been included in \Drupal\filter\Plugin\Filter\FilterUrl::process() and no replacement is provided.
See also
https://www.drupal.org/node/3566774
Related topics
File
-
core/
modules/ filter/ filter.module, line 375
Code
function _filter_url($text, $filter) {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. The logic has been included in \\Drupal\\filter\\Plugin\\Filter\\FilterUrl::process() and no replacement is provided. See https://www.drupal.org/node/3566774', E_USER_DEPRECATED);
$langcode = \Drupal::languageManager()->getCurrentLanguage()
->getId();
return \Drupal::service('plugin.manager.filter')->createInstance('filter_url', [
'settings' => $filter->settings,
])
->process($text, $langcode)
->getProcessedText();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.