WordPress filter hook

pmpro_checkout_end_date

Fired by 5 WordPress plugins, running on 10K+ sites between them.

“Filter the end date for the membership/subscription.”

How to use pmpro_checkout_end_date

It's a filter: your callback receives the value and 3 more arguments, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'pmpro_checkout_end_date', function( $enddate, $user_id, $membership_level, $startdate ) {
	// Change $enddate here.
	return $enddate;
}, 10, 4 );

Argument names come from Knit Pay's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

5 plugins that fire pmpro_checkout_end_date

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. AutomatorWP icon AutomatorWP6,000+ installs apply_filters( 'pmpro_checkout_end_date', $enddate, $user_id, $level_info, $startdate ) integrations/paid-memberships-pro/includes/actions/add-user-membership.php:103
  2. MStore API icon MStore API2,000+ installs apply_filters( 'pmpro_checkout_end_date', $enddate, $user_id, $pmpro_level, $startdate ) controllers/flutter-paid-memberships-pro.php:433
  3. Knit Pay icon Knit Pay2,000+ installs apply_filters( 'pmpro_checkout_end_date', $enddate, $morder->user_id, $morder->membership_level, $startdate ) extensions/PaidMembershipsPro/Extension.php:220
  4. TakBull For Paid Memberships Pro icon TakBull For Paid Memberships Pro30+ installs apply_filters( 'pmpro_checkout_end_date', $enddate, $morder->user_id, $morder->membership_level, $startdate ) includes/takbull_webhook.php:162
  5. Bitcoin payment for Paid Memberships Pro icon Bitcoin payment for Paid Memberships ProFewer than 10 installs apply_filters( 'pmpro_checkout_end_date', $enddate, $morder->user_id, $morder->membership_level, $startdate ) coinsnap-for-pmpro-class.php:834

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.