Hi, yes I think it's possible but it requires custom PHP. I don't have a cut-and-paste solution available, but I can show you some code examples and point you to the documentation for APIs that will be helpful here. I assume your Member Profile post has some connection to the WordPress User ID of the subscriber whose subscription was changed...either the User is the author of the Member Profile post or there is a custom field in the post or user profile that links these items.
You can use the WooCommerce Subscriptions API to listen for subscription status change events:
https://docs.woocommerce.com/document/subscriptions/develop/action-reference/#section-2
That change event hook gives you access to the new status and the old status, as well as an instance of the corresponding WC_Subscription object:
add_action( 'woocommerce_subscription_status_updated', 'status_update_callback', 1, 3);
function status_update_callback( $subscription, $old_status, $new_status ) {
// this function is triggered every time a subscription changes status so you can trigger different code
// based on whether the subscription is being deactivated, reactivated, or something irrelevant
}
The WC_Subscription Object extends WC_Order, so inside that callback you can get the subscriber's WordPress User ID like so:
$updated_sub_user_id = $subscription->get_user_id();
So far so good. Now you need a way to get the Member Profile post ID from the subscriber ID. If the MP author is the same as the subscriber whose subscription just changed, then you have a few options at this point. You can query posts by post author, arguments something like this:
$args = array(
'author' => $updated_sub_user_id,
'post_type' => 'your-member-profile-post-type-slug',
'orderby' => 'post_date',
'order' => 'ASC',
'posts_per_page' => 1
);
$member_profile_post = new WP_Query( $args );
...or you can create a View filtered by post author and use the Views API get_view_query_results: https://toolset.com/documentation/programmer-reference/views-api/#get_view_query_results
Change 12345 to match the View ID, and the code looks something like this:
$member_profile_posts = get_view_query_results( 12345 );
$mp_post_id = isset( $member_profile_posts[0]->ID ) ? $member_profile_posts[0]->ID : -1;
I can help you out with either of those options if you need assistance. Now let's assume you have the MP post ID. All you need to do now is change the post status to "draft":
$mp_post_id = 12345; // your member profile post id
$mp_post_args = array( 'ID' => $mp_post_id, 'post_status' => 'draft' );
wp_update_post($mp_post_args);
Let me know if this is making sense or if I have completely confused you.