Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $post = get_queried_object();
- if ( function_exists( 'pmpro_has_membership_access' ) ) {
- // Check if the user has access to the post.
- $hasaccess = pmpro_has_membership_access( $post->ID );
- // Display Advanced Custom Fields if the user has access to the post.
- if( ! empty( $hasaccess ) && function_exists( 'get_field' ) ) {
- if ( get_field( 'test_field_1' ) ) {
- the_field( 'test_field_1' );
- }
- if ( get_field( 'test_field_2' ) ) {
- the_field( 'test_field_2' );
- }
- }
- }
Add Comment
Please, Sign In to add comment