Add Meta Data fields to the Directory


Home Forums Front End PM PRO Add Meta Data fields to the Directory

This topic is: Not Resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13494
    Russ Catanach
    Participant

    I would like to add additional user data fields to each row of the directory. I am sure this possible but I can’t figure it out. How should I do this?

    #13499
    Shamim Hasan
    Keymaster

    You can add following code in your theme’s (child theme’s if any) functions.php (Change as required)

    add_filter('fep_directory_table_columns', function( $columns ){
    	$columns['cus_data'] = 'cus_data';
    	return $columns;
    });
    
    add_action( 'fep_directory_table_column_content_cus_data', function( $user ){
    	echo "Your custom data"; //Change here what you want to show
    });
    
    #42329
    Jerry Teo
    Participant

    Hi there.
    Thanks very much for the reply.

    so sorry. should have been more specific.
    If i wanted to display the phone number as a column? can this be done with the sample code above?

    Thanks very much.

    #42373
    Shamim Hasan
    Keymaster

    Yes, it can be done. Do you know meta_key of the phone number field of a user?

    #42399
    Jerry Teo
    Participant

    hi there

    thanks very much for the reply
    yes, should just be billing_phone

    kind regards

    #42408
    Shamim Hasan
    Keymaster

    In above code replace echo "Your custom data"; with echo $user->billing_phone;

Viewing 6 posts - 1 through 6 (of 6 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.