• Resolved syew91

    (@syew91)


    Hi admin/devs,

    I loved your plugin a lot and so far it has been very helpful for me.
    I ran into a small bump, and I was hoping that you could help me out. I am using your plugin, along side with LearnDash in my intranet. While I have a lot of information that is acquired when users register, I wanted to get some of the information to be displayed in LearnDash’s report when it generate the CSV. My question is, how do I make other plugins, in this case Learndash, to pull information from the User Registration plugin? (i.e. retrieving the registered data).

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter syew91

    (@syew91)

    Additional information:
    I can actually control the default WP information that goes into the report, with the following string:

    function report_column( $column_value = '', $column_key, $report_item, $report_user ) {
    			
    			switch( $column_key ) {
    				case 'user_id':
    					if ( $report_user instanceof WP_User ) {
    						$column_value = $report_user->ID;
    					}
    					break;
    
    				case 'user_name': 
    					if ( $report_user instanceof WP_User ) {
    						$column_value =  $report_user->display_name;
    						$column_value = str_replace("’", "'", $column_value );
    						
    					}
    					break;
    
    				case 'user_email':	
    					if ( $report_user instanceof WP_User ) {
    						$column_value = $report_user->user_email;
    					}
    					break;

    But that is as far as I can get. By default, the WP_users are all tables within the phpmyadmin itself. Thus it is possible for me to retrieve it without sweat. Now the problem is, I can’t seem to be able to find any tables created by User Registration, thus I am not sure on where to retrieve it.

    Hello @syew91,

    We are glad you liked our plugin. The extra information are stored in usermeta table in the database. You can get all the extra information registered by user registration plugin with this query:

    global $wpdb;
    $usermeta = $wpdb->get_results( "SELECT user_id, meta_key, meta_value FROM $wpdb->usermeta WHERE meta_key LIKE 'user_registration\_%';" );

    Also, you can use the action hook user_registration_after_register_user_action, which provides 3 parameters to the callback function, $form_data, $form_d and $user_id

    add_action( 'user_registration_after_register_user_action', 'ur_get_form_fields', 10, 3 );
    function ur_get_form_fields( $form_data, $form_id, $user_id) {
         // get data here
    }

    Hope this helps. If you are still facing issues, We’ll look into the working process of LearnDash LMS.

    Best Regards,
    WPEverest Support
    Sanjeev Aryal

    • This reply was modified 6 years, 10 months ago by Sanjeev Aryal.
    Thread Starter syew91

    (@syew91)

    Hi Sanjeev,

    Thanks for the explanation. And where would I put the lines into? Was it in the wp-include or user-registration plugin?

    Thread Starter syew91

    (@syew91)

    @sanzeeb3

    Yo my man can I check with you on the top query?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Integration with Learndash Reports’ is closed to new replies.