Home / Admin / Charitable: Force PayPal Legacy gateway
Duplicate Snippet

Embed Snippet on Your Site

Charitable: Force PayPal Legacy gateway

Overrides Charitable Pro 1.8.15+ PayPal tier detection at read-time so the legacy `paypal` gateway stays visible (and PayPal Commerce stays hidden) regardless of what was auto-detected on plugin upgrade.

David Bisset PRO
<10
Code Preview
php
<?php
  /**
   * Charitable — Force PayPal Legacy gateway on this site.
   *
   * Overrides Charitable Pro 1.8.15+ PayPal tier detection at read-time
   * so the legacy `paypal` gateway stays visible (and PayPal Commerce stays
   * hidden) regardless of what was auto-detected on plugin upgrade.
   *
   * No DB write — uses WordPress's `pre_option_*` short-circuit filter, so
   * disabling this snippet immediately reverts the site to whatever the
   * stored `charitable_paypal_user_tier` option says.
   *
   * Add via WPCode (PHP Snippet → Auto Insert → Run Everywhere).
   * To switch the site back to PayPal Commerce, simply deactivate this snippet.
   *
   * Tested with: Charitable Pro 1.8.15.
   */
  // Standard WordPress safety guard — prevents direct file access.
  if ( ! defined( 'ABSPATH' ) ) {
        return;
  }
  add_filter( 'pre_option_charitable_paypal_user_tier', function () {
        return 'legacy';
  } );

Comments

Add a Comment