NO BUG: Paid Memberships Pro Shortcodes not Rendering

Browser: Chrome 114.0.5735.248
OS: macOS

Hello Everyone,

I am working on membership website and using PmPro for membership functions.

None of their shortcodes work when I put them in the builder. It doesn’t render in the builder or the frontend.

I have tried enabling/disabling the Disable WP REST API render option in settings but it still doesn’t work.

Has anyone experienced this?

Hi @brijesh24 ,

May I know what shortcode you were trying to use?
Can you please give an example?

Regards,
Jenn

The shortcodes work for me.

I tried [pmpro_checkout] and [pmpro_levels] and they don’t work for me inside bricks. They work fine when used in Gutenburg.

I even disabled all plugins except PM Pro core and Bricks and it’s still the same.

Hmmmm you are right.
On my levels page I just have a container and a shortcode element in Bricks.
The page shows as Edit with Bricks.
I do not have Load/Save Gturd data settings enabled in Bricks.
It works.

However when I look at it in Gturd then I also see the shortcode.

I’m certain that I created all the PMP stuff in Bricks. But now creating a new page to test - it no longer works. I’m on 1.8.4

So not sure whats going on, but rather worried as just committed to build a new site based on PMP.

Hi @brijesh24 and @alanj

As far as I know, those shortcodes like [pmpro_checkout] [pmpro_levels} etc are telling the plugin which page or which URL should be redirected to if certain actions perform.

You also need to indicate it in the plugin’s setting page

Hence, it’s a must to place them in the Gutenberg editor.
image

Then if you wish to add more content to this page, you can edit it with Bricks and place a Post content element inside it.
image

Hope this helps.

Regards,
Jenn

Thanks Jenn,
I already have those and can, sort of, understand the limits around them. But there are other codes which I use inline.

Hello [pmpro_member field=“first_name”] [pmpro_member field=“last_name”]

These don’t seem to work either.
Checking all my pages and they all seem to echo the bricks content to the Gutenberg page, so maybe I enabled the data exchange at some point.

I’m spooling up a new site to test all this and have something to share if needed.

Some more info:

In PMP there seem to be two types of shortcode.
General page type codes that display a whole page, such as [pmpro_levels] which displays a page showing all the PMP levels you’ve set up. This only works on a gutenberg page. It does not work in Bricks using the Shortcode element.
Shortcodes to display various fields. e.g. [pmpro_member field=“last_name”]

The latter work in Bricks but only if you use the shortcode element. You can’t simply drop the code into say a Richtext or Basictext elements, just does nothing.

@itchycode So what would be needed to get the Bricks elements to display the PMP shortcodes so they can be used inline? Does PMP need to create an integration to make the output from their shortcodes available as dynamic Bricks data?

BTW @brijesh24 I’ve spoken with the PMP support. They don’t consider Bricks to be mainstream, yet, so don’t include it in their integrations ( they have Elementor, Divi and otrhers ) Maybe submit a ticket to them mentioning Bricks to try and raise awareness.

Fields available:
Supported “field” Values Include:

Membership Level Fields:

membership_id
membership_name
membership_description
membership_confirmation
membership_initial_payment
membership_billing_amount
membership_cycle_number
membership_cycle_period
membership_billing_limit
membership_trial_amount
membership_trial_limit
membership_startdate
membership_enddate

Payment Fields Stored in user_meta:

bfirstname
blastname
baddress1
baddress2
bcity
bstate
bzipcode
bcountry
bphone
bemail
CardType
AccountNumber
ExpirationMonth
ExpirationYear

Fields Stored in the users table

user_login
first_name
last_name
user_email
user_url
user_registered
display_name

Specialty Fields:

  • avatar

@itchycode Thank you for the reply. I will take a look and make it work like you mentioned.

@alanj Thank you for the looking into this in detail and posting here. It will help others like us. I’ve already created a support ticket with PMP and they are looking into my site with an admin login. I will update here when I hear back. And yes they did mention about not supporting bricks anytime soon similar to the other page builders.

Hi @alanj ,

In Bricks, we use dynamic tags for inline text which is much more flexible and supports in different elements.

I am not very sure the plugin stored the membership level fields in which location, so it’s quite hard for me to give you an accurate answer.

If it’s stored in user_meta, and you wish to display those user meta field for logged in user, you can use {wp_user_meta:my_user_meta_key}, example {wp_user_meta:bfirstname}

Thanks Jenn,

Yes they save some info in wp_users ( basic WP user registration stuff - I can get these as they are already listed in the dynamic field drop downs under User.) and some info in wp_usermeta.

I’ve tried using a variety of formats in the richtext/basic text elements to retrieve the usermeta fields.

In the database there is an entry in wp_usermeta with a meta_key of “pmpro_bfirstname” but using {wp_usermeta:pmpro_bfirstname} fails to retrieve its value. Also tried {wp_user_meta:pmpro_bfirstname} and {wp_user_meta:bfirstname} with no joy.

How should a plugin developer go about integrating their product? Is there a guide or any documentation? I know ACPT did it not so long ago and that works very well now.

Cheers
Alan

Hi Alan,

That’s interesting, {wp_user_meta:} should work.
Is it possible to provide me a temp admin access so I can check that?
Please email help@bricksbuilder.io and include this thread URL as a reference.

If plugin developer wants to integrate certain features in Bricks, they can go through all available hooks and documentation in Developer – Bricks Academy
If want to create dynamic data tag, just follow this guide Create Your Own Dynamic Data Tag – Bricks Academy

Developers are welcome to drop an email to help@bricksbuilder.io if need some advices from us.

Regards,
Jenn

Hi Jenn,
Thanks. I’ve now built a public site to test this all on.
I’ll send you an email with access details.

I have spoken with the PMP team and they gave me a Snippet to register their page shortcodes. Tested this and it works ( see the Levels page on my site )
However I’m still stuck on how to display the other PMP specific fields. ie their Membership fields and Payment fields. Anything in users table is fine.

Cheers
Alan

1 Like

Hi @alanj

Thanks for the login details.

Just check the way they store the data.

To output those Payment fields stored in user_meta, just need to add pmpro_ as the prefix.

Example:
bfirstname
{wp_user_meta:pmpro_bfirstname}

ExpirationMonth
{wp_user_meta:pmpro_ExpirationMonth}

CardType
{wp_user_meta:pmpuserfield1}

Custom user field like pmpuserfield1 in your website (no prefix needed)
{wp_user_meta:pmpuserfield1}

The full list inside your pmpfields page.

Actually the easiest way to make those member fields available inline (dynamic tag)
You can just create a simple function like this.

function brx_pmpro_member( $field ) {
  if ( empty( $field ) ) {
    return '';
  }
  ob_start();
  echo do_shortcode( '[pmpro_member field="' . $field .'"]' );
  return ob_get_clean();
}

Now, you can simply use
{echo:brx_pmpro_member('blastname')}
{echo:brx_pmpro_member('membership_billing_limit')}
{echo:brx_pmpro_member('last_name')}

Regards,
Jenn

1 Like

Jenn,
Thank you so much, that’s fantastic!

So if the PMP team wanted to better integrate with Bricks should they just use the Create your own Dynamic Tag article ( Create Your Own Dynamic Data Tag – Bricks Academy ) to make all their variables/fields available in Bricks drop downs under their own heading?
Also register their Page type Shortcodes so they can be used inside Bricks pages.

Many thanks again. Really appreciate your help.
Cheers
Alan

1 Like