• Resolved skyzlmt

    (@skyzlmt)


    Code Snippets doesnt see the PMpro functions at all!
    My own code was failing so then I used an example from you guys (larger block below) and further isolated to the code to see that :

    if( function_exists( 'pmpro_hasMembershipLevel' )

    … returns false! Its not finding the PMpro functions! Its the strangest thing as this worked with ARmember, but for PMpro it does not.
    (I am looking to move over to PMpro and simply want to convert a snippet I have to work with PMpro based on membership level. that failed so then i tried this sample from github which also failed )

    function premium42_class( $classes ) {

    global $current_user;
    if( function_exists( 'pmpro_hasMembershipLevel' ) && pmpro_hasMembershipLevel() ) {
    $classes[] = 'pmpro-body-has-level-' . $current_user->membership_level->ID;
    }

    return $classes;
    }
    add_filter( 'body_class', 'premium42_class');
    • This topic was modified 1 year ago by skyzlmt.
Viewing 1 replies (of 1 total)
  • Thread Starter skyzlmt

    (@skyzlmt)

    what I cant delete this embarassing post that I put way too much time into?

    I criss-crossed platforms. Those arent working in this product as they arent for this product. ugh.

    someone do me a favor and delete this ha

Viewing 1 replies (of 1 total)

The topic ‘PHP not seeing PMpro functions (via Code Snippets)’ is closed to new replies.