Title: RCP Multiple Subscriptions Fix
Last modified: July 20, 2020

---

# RCP Multiple Subscriptions Fix

 *  [adunsulag](https://wordpress.org/support/users/adunsulag/)
 * (@adunsulag)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/rcp-multiple-subscriptions-fix/)
 * Hi we recently upgraded our restrict content pro plugins and saw that it supports
   multiple subscriptions. The latest If-Menu plugin uses the deprectated rcp_get_subscription_id
   which only returns one of the subscriptions instead of checking against all of
   the subscriptions a user has. The following code snippets fix that problem. It
   would be great if this could be incorporated into the next version of the plugin.
   Hope this helps someone else.
 * In file: src/conditions-multiple-options.php lines 432-438 replace
 *     ```
       $userId = get_current_user_id();
   
       if (!$userId) {
         return false;
       }   
   
       return in_array(rcp_get_subscription_id($userId), $selectedLevels);
       ```
   
 * With this
 *     ```
       $current_customer_id = 0; // 0 gets current customer
   
       $level_ids = rcp_get_customer_membership_level_ids( $current_customer_id );
       // grab all the items that are the same between the customer levels and menu condition levels (array_intersect) return true if there is at least one element in comment between the two.
       return ! empty ( array_intersect( $level_ids, $selectedLevels ) );
       ```
   

The topic ‘RCP Multiple Subscriptions Fix’ is closed to new replies.

 * ![](https://ps.w.org/if-menu/assets/icon-256x256.png?rev=1862232)
 * [If Menu - Visibility control for Menus](https://wordpress.org/plugins/if-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/if-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/if-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/if-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/if-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/if-menu/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [adunsulag](https://wordpress.org/support/users/adunsulag/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/rcp-multiple-subscriptions-fix/)
 * Status: not resolved