Hi @webbernaut
Thank you for reaching out to Paid Memberships Pro.
You may adjust this using the following filters:
* https://www.paidmembershipspro.com/hook/pmpro_non_member_text_filter/
* https://www.paidmembershipspro.com/hook/pmpro_not_logged_in_text_filter/
You should also be able to apply the ‘do_shortcode’ filter to the above filters to convert shortcodes which may also work.
I hope this helps get you started.
Hey @andrewza,
could you possibly explain in more detail how to adjust the filters in order to show the shortcodes?
Thanks in advance!
@ritlance Not sure if you worked your way through this but here is a little help if you haven’t.
If you follow the hook link it will take you to the github source.
https://github.com/strangerstudios/paid-memberships-pro/blob/master/includes/functions.php
Here you can see how it’s used in the code written by paidmembership pro themselves.
On line 1925:
function pmpro_get_no_access_message( $content, $level_ids, $level_names = NULL )
Inside that function on line 1958:
You will see the filter text function being used. Not a member and not logged in are probably what you are looking for. As you can see they just add the text inside Advanced Settings.
stripslashes( pmpro_getOption( 'nonmembertext' ) )
So you can actually add your own text/function to replace this.
Inside your theme functions.php (custom theme or child theme) you declare your own function that you then apply to the filter. You can have two different outputs for non member and not logged in or just apply the same to both. A quick example is below. Hope this helps!
function custom_pmpro_non_member_text () {
...code goes here for the output you want or this could just be plain html or you can probably echo do_shortcode('shortcode') ...
}
add_filter( 'pmpro_non_member_text_filter', 'custom_pmpro_non_member_text' );
add_filter( 'pmpro_not_logged_in_text_filter', 'custom_pmpro_non_member_text' );