---
title: "rcp_member_calculated_expiration"
source: "https://docs.nexcess.com/software/kadence/restrict-content-pro/rcp_member_calculated_expiration/"
description: "Coming soon: Restrict Content Pro is becoming Kadence Memberships. You may see both names used while we update the product, documentation, and customer experien…"
vertical: "Software"
area: "Restrict Content Pro"
date: "2023-04-20"
last_modified: "2026-08-12"
---

# rcp_member_calculated_expiration

**Coming soon:** Restrict Content Pro is becoming Kadence Memberships. You may see both names used while we update the product, documentation, and customer experience.

Note: This is part of the developer docs and is considered custom code. Unfortunately, we cannot provide support for custom code at this time as we do not have the additional resources that would be necessary to provide support for custom code. If you need assistance with this, please reach out to our list of consultants for further assistance: https://codeable.io/developers/restrict-content-pro/ This filter was deprecated in version 3.0. Use rcp\_membership\_calculated\_expiration\_date instead. Filters the calculated expiration date for a member in RCP\_Member::calculate\_expiration(). This is usually used just before setting a member’s expiration date. This filter might be used if you want to change the calculated expiration date before it gets set, such as if you want all memberships to expire on the last day of the month, regardless of when they signed up. Parameters: $expiration – Calculated expiration date in MySQL format ( Y-m-d 23:59:59 ) or ‘none’ if unlimited. $user\_id – ID of the user the expiration date is being calculated for. $member – RCP\_Member object. Example: This example forces all expiration dates to be the end of the month. For example, if a user signs up for a 1-month subscription on July 15th, 2017, the calculated expiration date would be August 15th, 2017. This modification changes that to August 31st, 2017 instead. If you’d rather change it to be the last day of the current month then change strtotime( $expiration ) to be current\_time( ‘timestamp’ ) instead. In the above example, that would set the expiration date to July 31st, 2017. /\*\* \* Forces expiration dates to be the last day of the month. \* \* @param string $expiration Calculated expiration date in MySQL format or ‘none’. \* @param int $user\_id ID of the user the expiration date is being calculated for. \* @param RCP\_Member $member Member object. \* \* @return string New expiration date. \*/ function ag\_rcp\_member\_calculated\_expiration( $expiration, $user\_id, $member ) { // If the expiration date isn’t ‘none’, force it to be the last day of the month. if ( ‘none’ != $expiration ) { $expiration = date( ‘Y-m-t 23:59:59’, strtotime( $expiration ) ); } return $expiration; } add\_filter( ‘rcp\_member\_calculated\_expiration’, ‘ag\_rcp\_member\_calculated\_expiration’, 10, 3 ); Note: Changing the calculated expiration date does not change the renewal date with the gateway, so using this alongside auto-renewals is not recommended unless you also filter the gateway API call to modify the renewal date there.
