Change line 146 to this:
$new_excerpt_more = function($more) {
return '...';
};
Then change line 150 (now line 152) to this:
$new_excerpt_length = function($length) {
return $excerpt_length;
};
Hello,
I did what you have said here, but I receive a new error then:
Notice: Undefined variable: excerpt_length in
wp-content/plugins/ultimate-posts-widget/ultimate-posts-widget.php on line 150
Can you help out with that?
Thanks.
Zsuzsa
Yep there’s a typo in this, the lower one should read:
$new_excerpt_length = function($length) {
return $new_excerpt_length;
};
Okay, now I get an error again:
Notice: Undefined variable: new_excerpt_length in /wp-content/plugins/ultimate-posts-widget/ultimate-posts-widget.php on line 150
So what am I doing wrong?
What is the latest version of php the pugin runs with?
Sorry, thought this was for a different plugin, I don’t know
-
This reply was modified 7 years, 2 months ago by
Venutius.
@zsujoker You have to tell the function to use the variable from the parent scope. The earlier answer is partially correct, but this form of the function works:
$new_excerpt_length = function($length) use ($excerpt_length){
return $excerpt_length;
};
I submitted a pull request to the plugin developer to fix it, hopefully he’ll update it.