WordPress.org

Forums

Sharebar
PATCH sharebar 1.2.5 fix undefined variable error (1 post)

  1. lkraav
    Member
    Posted 2 years ago #

    Your current sharebar_auto() approach isn't very good. The if condition can easily fail and then you're accessing variables that were only set inside the if. Here's a better function version:

    98 function sharebar_auto($content){
     99     if((get_option('sharebar_auto_posts') && is_single()) || (get_option('sharebar_auto_pages') && is_page())){
    100         $str = sharebar(false); $str .= sharebar_horizontal(false);
    101         $content = $str.$content;
    102     }
    103
    104     return $content;
    105 }

    http://wordpress.org/extend/plugins/sharebar/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Sharebar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags