Additional menu

Get MemberPress today! Start getting paid for the content you create! Get MemberPress Now
  1. Home
  2. Knowledge Base
  3. General
  4. Members and Accounts
  5. Account
  6. Change Plan Option Doesn’t Work On A Custom Account Page
  1. Home
  2. Knowledge Base
  3. Advanced Topics
  4. Custom Codes
  5. Account Customizations
  6. Change Plan Option Doesn’t Work On A Custom Account Page
  1. Home
  2. Knowledge Base
  3. Troubleshooting
  4. Miscellaneous Issues
  5. Change Plan Option Doesn’t Work On A Custom Account Page

Change Plan Option Doesn’t Work On A Custom Account Page

MemberPress comes with a default Account page, but in some cases, you might need a custom solution. MemberPress mepr-account-form shortcode allows you to add the user account form to any custom page.  

Adding the shortcode to a page using a page builder, could create an issue with the functioning of the Change Plan option.

This document will provide more details on this issue and how to solve it.

Why Is This Happening?

Clicking the Change Plan option on the MemberPress account page will trigger a quick selection pop-up.

This is the default option unless you check the Disable Change Plan Pop-Up in the MemberPress Group Options

MemberPress identifies a custom page as the Account page by scanning the page content area and searching for the shortcode:

[mepr-account-form]

On the other hand, some page builders, like Beaver Builder, might store the shortcode outside of the page content area. In this case, MemberPress won’t detect the shortcode as present. Thus, your custom page won’t be recognized as the account page, preventing the Change Plan pop-up from being triggered. 

How To Make This Work?

If this is the situation you’re experiencing, you will need to manually mark your custom page as the account page. For MemberPress to recognize your custom page as the account page, you’ll need to use the following custom code snippet:

add_filter('mepr_is_account_page', function($is_account_page, $post) {
	if(isset($post->ID) && $post->ID == '123') {
		return true;
	}
	
	return $is_account_page;
}, 10, 2);

You’ll first need to adjust the above-mentioned code example. Here, you’ll need to replace the ID used in the example (123) with the ID of your custom account page. You would change the page or post ID on the following line:

	if(isset($post->ID) && $post->ID == '123') {

Once you updated the code with the IDs of your pages and posts, you can add the code snippet to your website to the functions.php file of your child theme. As an alternative, you can use the WPCode plugin. Please check the following document for step-by-step instructions on How To Add Custom Code Snippets in WPCode.

Activating this code snippet on your site should enable the Change Plan pop-up on your custom account page.

Note: The code above uses the mepr_is_account_page filter hook. For more details about using this filter hook check the Filter Hooks in MemberPress document.

Was this article helpful?

Related Articles

computer girl

Get MemberPress today!

Start getting paid for the content you create.