Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

If member ID php tweak Not working

Simple Membership Plugin › Forums › Simple Membership Plugin › If member ID php tweak Not working

Tagged: If member

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 4 months ago by admin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 3, 2016 at 1:57 pm #5125
    Jamonzito
    Participant

    Hi Im trying to display certain content for an specific member id, I wrote the php tweak in this way <?php

    $member_id = SwpmMemberUtils::get_logged_in_members_id();
    if ($member_id == “4”){
    woocommerce_template_single_add_to_cart();
    } else {
    echo ‘…..’;

    }
    ?>

    But when I log in whit member id 4 nothing is shown what am I doing wrong ??

    Thanks

    February 6, 2016 at 10:03 am #5152
    admin
    Keymaster

    echo the member ID before you use the “if” statement so you know if the ID is getting retrieved correctly. Also, make sure that you are calling that function after the simple membership plugin is loaded (using the “plugins_loaded” hook). Otherwise that function won’t return anything if it hasn’t loaded yet.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy