Twenty Eleven: run twentyeleven_url_grabber once in widgets.php, props duck_ -- closes #17279

git-svn-id: https://develop.svn.wordpress.org/trunk@17917 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Lance Willett 2011-05-13 16:25:53 +00:00
parent 9f6254e9dc
commit cfdfbac9e9
1 changed files with 4 additions and 3 deletions

View File

@ -99,10 +99,11 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
<li class="widget-entry-title">
<?php
$link_url = get_permalink();
// Grab first link from the post content. If none found, use the post permalink as fallback.
$link_url = twentyeleven_url_grabber();
if ( false != twentyeleven_url_grabber() )
$link_url = twentyeleven_url_grabber();
if ( empty( $link_url ) )
$link_url = get_permalink();
?>
<a href="<?php echo esc_url( $link_url ); ?>" title="<?php printf( esc_attr__( 'Link to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>&nbsp;<span>&rarr;</span></a>
<span class="comments-link">