wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_extract_urls › WordPress Function
Since3.7.0
Deprecatedn/a
› wp_extract_urls ( $content )
Parameters: |
|
Returns: |
|
Defined at: |
|
Codex: |
Use RegEx to extract URLs from arbitrary content.
Related Functions: wp_registration_url, wp_get_attachment_url, wp_insert_user, wp_get_update_php_url, wp_privacy_exports_url
Source
function wp_extract_urls( $content ) { preg_match_all( "#([\"']?)(" . '(?:([\w-]+:)?//?)' . '[^\s()<>]+' . '[.]' . '(?:' . '\([\w\d]+\)|' . '(?:' . "[^`!()\[\]{};:'\".,<>«»“”‘’\s]|" . '(?:[:]\d+)?/?' . ')+' . ')' . ")\\1#", $content, $post_links ); $post_links = array_unique( array_map( 'html_entity_decode', $post_links[2] ) ); return array_values( $post_links ); }