/**
 * This will hide subscription levels on the registration form page
 * if their price is lower than the price of member's current
 * subscription level.
 */
function jp_hide_lower_cost_levels($levels)
{
    if (!rcp_is_registration_page() || !is_user_logged_in()) {
        return $levels;
    }
    $existing_sub = rcp_get_subscription_id(wp_get_current_user()->ID);
    if (empty($existing_sub)) {
        return $levels;
    }
    foreach ($levels as $key => $level) {
        if (rcp_get_subscription_price($level->id) < rcp_get_subscription_price($existing_sub)) {
            unset($levels[$key]);
        }
    }
    return $levels;
}
/**
 * Load webhook processor for all gateways
 *
 * @access      public
 * @since       2.1
 * @return      void
*/
function rcp_load_gateway_scripts()
{
    global $rcp_options;
    if (!rcp_is_registration_page()) {
        return;
    }
    $gateways = new RCP_Payment_Gateways();
    foreach ($gateways->enabled_gateways as $key => $gateway) {
        if (is_array($gateway) && isset($gateway['class'])) {
            $gateway = new $gateway['class']();
            $gateway->scripts();
        }
    }
}