PMP export CSV, call in PODs user field
-
As a non-paying (I’m a broke self-employed designer) PMP user, I’ve been directly editing PMP’s pages PHP to do my evil bidding, and display custom User fields from the PODs plugin.
For example, I made a User field named student_name, that I wanted to display in my PMP member’s list and printout in the “Export CSV” option (That’s my issue, but we’ll get to that)
Here’s how to do the first part:
Pods > create new user pod > Label whatever > name(mine is student_name)
Then I opened PMP’s Memberslist.php and added the 3rd line below (ctrl+f the second line to see where to put it)
<td><?php echo $metavalues->first_name?></td> <td><?php echo $metavalues->last_name?></td> <td><?php echo get_user_meta( $theuser->ID, 'podfield_name', true ); ?></td>
Don’t forget to add a column in the spreadsheet! (Again, add the last line, and serach for any of the other’s)
<tr class="thead"> <th>ID</th> <th>Username</th> <th>First Name</th> <th>Last Name</th> <th>Student Name</th>
Now for my current problem
I’d like to pull that same data into the CSV as it exports, and memberslist-cvs.php does things a little differently – it took me 2 weeks of searching to figure out the first part (remember, I said I’m a designer, not a developer:), so now I’m asking for help.
I’ve added a column to the CSV export php (student name again, creates column in spreadsheet)
$csvoutput = "id,username,firstname,lastname,student name,email,billing firstname,
but membership-csv.php uses an array to call in data, which looks like this
//these are the meta_keys for the fields (arrays are object, property. so e.g. $theuser->ID) $default_columns = array( array("theuser", "ID"), array("theuser", "user_login"), array("metavalues", "first_name"), array("metavalues", "last_name"),
I’m new with PHP, I don’t know where or how I need to call in the PODs field, but nothing I’ve tried has worked.
Tried this:
$student = get_user_meta( $theuser->ID, 'student_name', true );
with a few different array values
array("theuser", "student_name"), //and tried array("metavalues", "student_name"), //and tried array("theuser", "student_name"), //and tried array($student),
Any and all help appreciated, and I hope the first part helped someone.
https://www.ads-software.com/extend/plugins/paid-memberships-pro/
- The topic ‘PMP export CSV, call in PODs user field’ is closed to new replies.