A Cozmoslabs Product
Documentation / Developer Knowledge Base / Customizations for pms-account actions

Customizations for pms-account actions

Remove Renew button

Remove the Renew button for a specific subscription:

add_filter( 'pms_output_subscription_plan_action_renewal', 'pmsc_remove_renew_from_plan', 20, 2 );
function pmsc_remove_renew_from_plan( $output, $subscription_plan ){
    if( $subscription_plan->id == 'IDplan' )
        return '';
        
    return $output;
}

You can get the subscription plan ID from PMS→ Subscription Plans→ ID.

Remove the Renew button for multiple subscription plans:

add_filter( 'pms_output_subscription_plan_action_renewal', 'pmsc_remove_renew_from_plan', 20, 2 );
function pmsc_remove_renew_from_plan( $output, $subscription_plan ){
    // alternative for multiple plans
    if( in_array( $subscription_plan->id, array( 'IDplan1', 'IDplan2' ) ) )
        return '';
        
    return $output;
}

You can get the subscription plan ID from PMS→ Subscription Plans→ ID.

Remove Abandon button

Remove the Abandon button for a specific subscription:

add_filter( 'pms_output_subscription_plan_action_abandon', 'pmsc_hide_abandoned_action_for_specific_plan', 20, 2 );
function pmsc_hide_abandoned_action_for_specific_plan( $output, $subscription_plan ) {
    if( $subscription_plan->id == 'IDplan' )
        return '';
        
    return $output;
}

You can get the subscription plan ID from PMS→ Subscription Plans→ ID.

Remove Cancel button

Remove the Cancel button for a specific subscription:

add_filter( 'pms_output_subscription_plan_action_cancel', 'pmsc_hide_cancel_for_plan', 20, 2 ); 
function pmsc_hide_cancel_for_plan( $cancel_link, $subscription_plan ){
    if( $subscription_plan->id == 'IDplan' )
        $cancel_link = '';
        
    return $cancel_link;
}

You can get the subscription plan ID from PMS→ Subscription Plans→ ID.

Remove Change button

Remove the Change button for a specific subscription:

add_filter( 'pms_member_change_subscription_other_plans', 'pmsc_filter_available_upgrades' );
function pmsc_filter_available_upgrades( $upgrade_plans ){

    $allowed_plan_ids = array( IDplan1, IDplan2 );

    if( !empty( $upgrade_plans ) ){
        foreach( $upgrade_plans as $key => $plan ){
          if( !in_array( $plan->id, $allowed_plan_ids ) )
            unset( $upgrade_plans[$key] );
        }
    }

    return array_values( $upgrade_plans );
    
}

You can get the subscription plan ID from PMS→ Subscription Plans→ ID.

Paid Member Subscriptions Pro

Accept (recurring) payments, create subscription plans and restrict content on your website. Easily setup a WordPress membership site using Paid Member Subscriptions.

Get Paid Member Subscriptions

The Ultimate Membership Bundle

Combine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.

Get 25% off with the bundle

Help & Support

We’re here to help you every step of the way.

Open a Support Ticket