Plugin Directory

Changeset 1538337


Ignore:
Timestamp:
11/22/2016 12:15:53 PM (9 years ago)
Author:
mraliende
Message:

bugfix in excerpt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • good-url-preview-box/trunk/gurlpb-start.php

    r1537803 r1538337  
    158158    Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "]: postId:" . get_the_ID() . $str_content);
    159159
    160 
    161     if(is_single() || is_page() || is_attachment()) {
    162         Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "]: is_single:" );
    163     } else {
    164         Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "]: ! is_single:");
    165     }
    166     Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "]: $str_content");
    167 
    168160    if ( ! Gurlpb::$_f_add_js && $strUrl=Gurlpb::has_url( $str_content ) ) {
    169161        Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "]: add JS!" );
    170162        Gurlpb::$_f_add_js = 1;
    171         echo  gurlpb_add_previewbox( $strUrl );
     163        if ( is_single() || is_page() || is_attachment() ) {
     164            $str_content .= gurlpb_add_previewbox( $strUrl );
     165        } elseif ( in_the_loop() )  {
     166            echo gurlpb_add_previewbox( $strUrl );
     167        }
    172168        add_action( 'wp_footer', 'gurlpb_javascript_include', 20 );
    173169    }
     
    390386        if ( Gurlpb::$_str_first_url ) {
    391387            $text .= '<p><a class="gurlpb" href="' . Gurlpb::$_str_first_url . '" style="color: #888; display: block; width:80px; opacity: 0.2; font-size:9px; margin-left:auto; margin-right:auto;" >UrlPreviewBox</a></p>';
    392             if ( ! Gurlpb::$_f_add_js ) {
     388            if ( ! Gurlpb::$_f_add_js  ) {
    393389                Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "]: add JS!" );
    394390                Gurlpb::$_f_add_js = 1;
    395                 echo  gurlpb_add_previewbox( Gurlpb::$_str_first_url );
     391
     392                if ( in_the_loop() ) echo gurlpb_add_previewbox( Gurlpb::$_str_first_url );
    396393                add_action( 'wp_footer', 'gurlpb_javascript_include', 20 );
    397394            }
Note: See TracChangeset for help on using the changeset viewer.