Simple Membership Plugin › Forums › Simple Membership Plugin › Programmatically display Members List with PHP
Tagged: members list
- This topic has 5 replies, 3 voices, and was last updated 3 years, 7 months ago by
admin.
-
AuthorPosts
-
February 17, 2023 at 8:45 pm #25288
peakwebs
ParticipantHello,
I would like to create a custom table in PHP/HTML to display all members and certain member info. What I am looking to find is the PHP Object to look into to be able to start extracting the values. I looked at the documentation but didn’t see anything I could use in the PHP Tweaks section (https://simple-membership-plugin.com/simple-membership-miscellaneous-php-tweaks/).
Does anybody with a little more advanced coding knowledge know how I can access this ‘Members’ object in PHP so I can create this members directory table? I know there is an Add-on available but I’m curious if I can do this myself, programmatically.
Thank you very much,
DavidFebruary 18, 2023 at 1:49 am #25290The Assurer
ModeratorHave you looked at the Member Directory Listing Addon?
https://simple-membership-plugin.com/simple-membership-member-directory-listing-addon/February 28, 2023 at 12:14 am #25612peakwebs
ParticipantHi, yes I have but I was hoping to figure out how I can code the thing myself.
February 28, 2023 at 12:58 am #25617admin
KeymasterYou are free to change/tweak what you want to change if you are a coder. However, this will be a lot of coding work and some advanced coding knowledge will be required. So I won’t recommend taking this on if you are not an advanced coder. Providing coding guidelines/help of this magnitude will be beyond the scope of this free support.
February 28, 2023 at 2:38 am #25619peakwebs
ParticipantThanks for your response. I’m really only looking to output a basic table of members and mostly curious to just have a look at the PHP Object that contains the members info. If I can access it, I can at least take a look under the hood and decide if that’s something I want to undertake.
February 28, 2023 at 7:28 am #25620admin
KeymasterThe member’s data is stored in the Database table. You can query the DB table to retrieve the details then loop through the result and output details in a format that you want.
Here is a function that can be useful to get a list of members from a particular membership level. You can then loop through the resultset:
https://github.com/wp-insider/simple-membership/blob/94b8ed337d7c2a6c70cd369c554ae27d919773de/simple-membership/classes/class.swpm-utils-member.php#L148-L154The code from the following free addon might be helpful:
https://simple-membership-plugin.com/simple-membership-addon-show-member-info/ -
AuthorPosts
- You must be logged in to reply to this topic.