---
title: "rcp_set_status"
source: "https://docs.nexcess.com/software/kadence/restrict-content-pro/rcp_set_status/"
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_set_status

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

This action has been deprecated. Use rcp\_transition\_membership\_status instead. 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 action is triggered whenever a user’s status (pending, free, active, expired, canceled) is set. Parameters: $new\_status – Name of the new status being set (pending, free, active, expired, canceled). $user\_id – ID of the user whose status is being changed. $old\_status – The member’s previous status before this change. $member – The RCP\_Member object for this user. Similar Actions: RCP also has a dynamic action that is fired at the same time: rcp\_set\_status\_{$new\_status}. This action is exactly the same, but the $new\_status variable is included in the status name instead of as a parameter. Here are two examples that achieve the same result: function ag\_rcp\_set\_status( $new\_status, $user\_id, $old\_status, $member ) { if ( ‘active’ == $new\_status ) { // Your custom code in here to be run when status is set to ‘active’. } } add\_action( ‘rcp\_set\_status’, ‘ag\_rcp\_set\_status’, 10, 4 ); function ag\_rcp\_set\_status\_active( $user\_id, $old\_status, $member ) { // Your custom code in here to be run when status is set to ‘active’. } add\_action( ‘rcp\_set\_status\_active’, ‘ag\_rcp\_set\_status\_active’, 10, 3 ); rcp\_set\_status\_active is a good action to use if you need to trigger some code immediately after a subscription is activated. But note this action may also run after renewals and upgrades, so if you only want your code triggered once, it’s helpful to set a piece of user meta to indicate that your action has already been completed. For example: function ag\_rcp\_set\_status\_active( $user\_id, $old\_status, $member ) { $has\_completed = get\_user\_meta( $user\_id, ‘rcp\_has\_completed\_some\_custom\_action’, true ); if ( $has\_completed ) { // We’ve already done this for this user! Bail! return; } // Insert your custom code here. // Now set the flag so we don’t run it again. update\_user\_meta( $user\_id, ‘rcp\_has\_completed\_some\_custom\_action’, true ); } add\_action( ‘rcp\_set\_status\_active’, ‘ag\_rcp\_set\_status\_active’, 10, 3 );
