PHP Notice: addthis_social_widget.php:1301 Undefined variable: below_excerpt fix
-
The latest version of the plugin is not causing any visual errors but it is throwing a notice on one of my custom post type templates. I was able to fix this notice by changing line 1300 to
} elseif ( isset( $below_excerpt ) && $below_excerpt
[as the $below_excerpt is apparently null and throwing the notice by being uncheckable]. this didn’t seem to effect the area where I do want the buttons to show – not even on the template w the error.NOTICE: wp-content/plugins/addthis/addthis_social_widget.php:1301 - Undefined variable: below_excerpt require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/mytheme/single-mycustomposttype.php'), the_content, apply_filters('the_content'), call_user_func_array, addthis_display_social_widgeti used the filter to nix the appearance of this on the custom post type. Notice is not appearing on my other custom post types, BTW i narrowed down their display this way:
function mytheme_addthis_post_exclude_filter($display) { //_log('filter fires'); if ( in_array(get_post_type(), array('project', 'bio','mycustomposttype')) ) { $display = false; } return $display; } add_filter('addthis_post_exclude', 'fp_callahan_addthis_post_exclude_filter');
The topic ‘PHP Notice: addthis_social_widget.php:1301 Undefined variable: below_excerpt fix’ is closed to new replies.