WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Error manually placing AddToAny: Subscribe in sidebar (6 posts)

  1. PhynaeusClaw
    Member
    Posted 3 years ago #

    I am trying to manually place the AddToAny:Subscribe widget manually on my page. I am using the code provided on the Settings -> Subscribe Buttons page:
    <?php if( class_exists('Add_to_Any_Subscribe_Widget') ) { Add_to_Any_Subscribe_Widget::display(); } ?>

    However, when the page is rendered I get the following errors:

    Warning: Missing argument 2 for Add_to_Any_Subscribe_Widget::display(), called in /home/tahsiafriedman/tahsiafriedman.com/tahsiablog/wp-content/themes/hope-child/sidebar.php on line 4 and defined in /home/tahsiafriedman/tahsiafriedman.com/tahsiablog/wp-content/plugins/add-to-any-subscribe/add-to-any-subscribe.php on line 53

    Fatal error: Call to undefined function widget() in /home/tahsiafriedman/tahsiafriedman.com/tahsiablog/wp-content/plugins/add-to-any-subscribe/add-to-any-subscribe.php on line 54

    The website is http://tahsiafriedman.com. However I have removed the code because it renders the website virtually unusable.

    Any ideas???

    P.S. - I'm new to the forums. Sorry if I've broken rules by replying to and editing my own posts.

  2. gurustump
    Member
    Posted 3 years ago #

    I'm getting the same problem now that I have upgraded to the most recent version of Add to Any: Subscribe. I've had the plugin working properly in my site for some time, but when I used WordPress' automatic update feature to bring it up to version .9.9.

    Lines 53 and 54 of wp-content/plugins/add-to-any-subscribe/add-to-any-subscribe.php are commented as handling "/** Backwards compatibility for Add_to_Any_Subscribe_Widget::display(); usage */". It appears that in the latest update this backwards compatibility feature got broken. I suppose many people use the thing as a widget so they can have the ease of drag-and-drop to get it into their site, but I'm hoping the developers behind add-to-any will still permit us to just use the code snippet top pop it in wherever we want.

  3. micropat
    Member
    Posted 3 years ago #

    Thanks PhynaeusClaw and gurustump for the reports!

    Fixed in the latest release, version .9.9.1.

  4. PhynaeusClaw
    Member
    Posted 3 years ago #

    It is indeed fixed! Thank you!

  5. luxxor
    Member
    Posted 3 years ago #

    Hello,

    unfortunately, the issue is not fixed completely. If PHP 4.x is used, then the latest fix .9.9.1 results in a fatal error. For example: Fatal error: Undefined class name 'self' in /home/.../wp-content/plugins/add-to-any-subscribe/add-to-any-subscribe.php on line 54.

    This error is quite common and can be found for example here:
    http://ffynnonweb.com/
    http://hostalsalinas.com/wordpress/?p=191
    http://blog.cyclingo.com.au/

    Thanks for the correction,
    Marc

  6. luxxor
    Member
    Posted 3 years ago #

    Here's the proper fix which works with PHP 4 as well:

    function display( $args = false ) {
      // replace this line: self::widget($args, NULL);
      Add_to_Any_Subscribe_Widget::widget($args, NULL);
    }

    Enjoy,
    Marc

Topic Closed

This topic has been closed to new replies.

About this Topic