• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Add a link to the Restrict Content Pro customer page for WordPress users

Find out in this tutorial how to add a link that directs to the Restrict Content Pro customer page from the WordPress user panel using code.

If you have a membership site created with Restrict Content Pro it is likely that more than once you go from Users to Customers and vice versa. Especially if you use the User Switching plugin to check how the subscriber sees the content.

So, being able to access the customer page from the users section can be very practical and save you time.

The good news is that with a little bit of code you can achieve this:

add-client-link-Restrict-Content-Pro-user-WordPress

Let’s see how:

Snippet to insert a link on WordPress users leading to their customer tabs in Restrict Content Pro

Add the following code at the end of functions.php or in your functionality plugin:

To see this and another 847 code snippets of this website, login or subscribe here.

With this snippet you use the user_row_actions filter to display a link on WordPress users that allows you to go directly to their Restrict Content Pro client tab.

You also use the rcp_get_customer_by_user_id function to get the RCP_Customer object and extract the necessary customer information (the ID in this case).

Also, thanks to the conditionals you use, the link will be shown only to users who have a customer created with Restrict Content Pro.

Finally, you can change the “Go to customer file” text to whatever you prefer.

Conclusions

Now you know how to display a link to the Restrict Content Pro customer page on WordPress users with a little bit of code.

Any questions? Let me know in the comments.

And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉

PHP Restrict Content Pro

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?