Plugin Directory

Changeset 1472719


Ignore:
Timestamp:
08/12/2016 02:15:07 AM (10 years ago)
Author:
LABCAT
Message:

fixing bug in the the_excerpt_max_charlength function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • responsive-portfolio-gallery/tags/1.1/shortcodes/shortcodes.php

    r1472715 r1472719  
    264264   
    265265    public function the_excerpt_max_charlength($charlength) {
     266        $result =  "";
    266267        $excerpt = get_the_excerpt();
    267268        $charlength++;
     
    272273            $excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) );
    273274            if ( $excut < 0 ) {
    274                 echo mb_substr( $subex, 0, $excut );
     275                $result .= mb_substr( $subex, 0, $excut );
    275276            } else {
    276                 echo $subex;
     277                $result .= $subex;
    277278            }
    278             echo '[...]';
     279            $result .= '[...]';
    279280        } else {
    280             echo $excerpt;
    281         }
     281            $result = $excerpt;
     282        }
     283        return $result;
    282284    }
    283285}
Note: See TracChangeset for help on using the changeset viewer.