WordPress.org

Make WordPress Core

Changeset 17917


Ignore:
Timestamp:
05/13/2011 04:25:53 PM (10 years ago)
Author:
lancewillett
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/inc/widgets.php

    r17787 r17917  
    100100            <li class="widget-entry-title">
    101101                <?php
    102                     $link_url = get_permalink();
     102                    // Grab first link from the post content. If none found, use the post permalink as fallback.
     103                    $link_url = twentyeleven_url_grabber();
    103104
    104                     if ( false != twentyeleven_url_grabber() )
    105                         $link_url = twentyeleven_url_grabber();
     105                    if ( empty( $link_url ) )
     106                        $link_url = get_permalink();
    106107                ?>
    107108                <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>
Note: See TracChangeset for help on using the changeset viewer.