• Resolved zup44

    (@zup44)


    Hello,

    I installed pro paid subscriptions for free !!
    I configured the plugin and followed the link to protect ACF content :
    https://www.paidmembershipspro.com/restrict-the-display-of-advanced-custom-fields-acf-fields-by-membership-level/.

    I opted for option 1 :

    // Display Advanced Custom Fields for Levels 1 and 2 only.
    if ( function_exists( 'get_field' ) && function_exists( 'pmpro_hasMembershipLevel' ) ) {
    	if( pmpro_hasMembershipLevel( array('1', '2' ) ) ) {
    		if ( get_field( 'test_field_1' ) ) {
    			the_field( 'test_field_1' );
    		}
    
    		if ( get_field( 'test_field_2' ) ) {
    			the_field( 'test_field_2' );
    		}
    	}
    }

    The content of my album page is well protected.
    Except that I have no link on the page to redirect the user to the page of paid subscription levels Pro.

    What must be added to be able to have a sentence and a link like: “You do not have access to the content.
    You must register by clicking on the following link: XXXXXX “??

    Thank you for your help !!
    Nico

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hi Nico,

    Thank you for using Paid Memberships Pro. You will need to add an else clause to the if( pmpro_hasMembershipLevel( array( '1', '2' ) ) ) { check and show a non-member/logged-out message for users that don’t have access.

    I hope this helps get you started.

Viewing 1 replies (of 1 total)
  • The topic ‘Protect Advenced Custom Fields (ACF)’ is closed to new replies.