- This topic has 2 replies, 2 voices, and was last updated 6 years, 11 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
WordPress Membership Plugin
Simple Membership Plugin › Forums › Simple Membership Plugin › Outputting 'form builder' fields in member directory
Hi,
I have created a member directory but cannot output the custom form fields (created with the form builder addon) as they are not stored in the main member table.
How can I output these fields?
I have submitted a support request for this over a week ago and not had a reply despite it saying a response would be received within 24 hours.
Thanks
EXAMPLE CODE BELOW BUT THE CALLOUTS FOR FIELDS SUCH AS “DISCIPLINE” or “POSITION” DONT WORK AS THE FORM-BUILDER ADDON STORES THESE ENTRIES IN DIFFERENT TABLES TO WHERE THE MAIN MEMBERS ARE.
—————————————————–
<?php
global $wpdb;
$table_name = $wpdb->prefix . “swpm_members_tbl”;
$blogusers = $wpdb->get_results( “SELECT * FROM $table_name” );
foreach( $wpdb->get_results(“SELECT * FROM swpm_form_builder_custom WHERE id LIKE’ . $id . ‘;”) as $key => $row) {
// each column in your row will be accessible like this
$my_column = $row->field_id;}
foreach ( $blogusers as $user ) {
echo
‘<div class=”col-md-3″>
<div>
<p>Member Name: <br>’ . esc_html( $user->first_name ) . ‘ ‘ . esc_html( $user->last_name ) . ‘</p><br>’;
echo ‘<p>Organisation: <br>’ . esc_html( $user->company_name ) . ‘</p><br>’;
echo ‘<p>Discipline: ‘ . esc_html( $my_column->discipline ) . ‘</p><br>’;
echo ‘<p>Position: ‘ . esc_html( $user->user_nicename ) . ‘</p><br>’;
echo ‘<p>Research Interest: ‘ . esc_html( $user->research_interest ) . ‘</p><br>’;
echo ‘</div></div>’;
}?>
Hi, for premium addons please create a premiun addon support ticket. One of the developers will assist you further.
Kind regards