Support » Plugin: PayPal Donations » Weird Theme Error

  • Resolved genesteinberg

    (@genesteinberg)


    Since version 1.7, I have been unable to use this plugin. I get this message where the button is supposed to appear:

    Fatal error: Class ‘paypal_donations’ not found in /home/technigh/public_html/wp-content/themes/technightowl/single.php on line 47

    The section referenced has something inserted by a theme designer with whom I have no present contact.

    <?php
    $paypal = new paypal_donations();
    $atts=”;
    echo $paypal->paypal_shortcode($atts);
    ?>

    What do I change to get your shortcode to function?

    Peace,
    Gene

    http://wordpress.org/extend/plugins/paypal-donations/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Johan Steen

    (@artstorm)

    Hi Gene,

    The class has changed name since v1.7, so it’s now called PayPalDonations() instead of paypal_donations(). And it’s now a Singleton class, so if it’s already been initiated (which it has by the plugin system, it shouldn’t be started with a new)

    If the theme is calling the plugin directly you need to modify the code you posted above slightly. Also the method to generate the shortcode has changed name from paypal_shortcode() to paypalShortcode().

    Modifying your block of code to this, should do the trick for you:

    <?php
        $paypal = PayPalDonations::getInstance();
        $atts='';
        echo $paypal->paypalShortcode($atts);
    ?>

    Cheers,
    Johan

    genesteinberg

    (@genesteinberg)

    Maybe, but now it says:

    Fatal error: Call to private PayPalDonations::__construct() from invalid context in /home/technigh/public_html/wp-content/themes/technightowl/single.php on line 47

    Peace,
    Gene

    Plugin Contributor Johan Steen

    (@artstorm)

    Gene, I just modified my reply above, with a code change. As I just realized that new won’t work anymore either when calling the plugin code from outside the plugin. So try the code above now.

    Cheers,
    Johan

    genesteinberg

    (@genesteinberg)

    OK, we’re good now.

    Thanks.

    Peace,
    Gene

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Weird Theme Error’ is closed to new replies.