Skip to content

Instantly share code, notes, and snippets.

@rodrigomuniz
Last active December 11, 2015 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodrigomuniz/4670975 to your computer and use it in GitHub Desktop.
Save rodrigomuniz/4670975 to your computer and use it in GitHub Desktop.
Teste
<?php
function get_content_link( $content = false, $echo = false ) {
if ( $content === false )
$content = get_the_content();
$content = preg_match_all( '/hrefs*=s*["']([^"']+)/', $content, $links );
$content = $links[1][0];
if ( empty($content) ) {
$content = false;
}
return $content;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment