Support » Plugin: WP-Members Membership Plugin » empty user_url field in csv file

Viewing 3 replies - 1 through 3 (of 3 total)
  • OK, I found a solution for this, but you should include that in your next update:

    In admin/user-export.php, first go to line 75 and replace

    if( $wpmem_fields[$row][2] == 'user_email' ) {
    				$data.= '"' . $user_info->user_email . '",';
    			} else {
    				$data.= '"' . get_user_meta( $user, $wpmem_fields[$row][2], true ) . '",';
    			}

    with

    if( $wpmem_fields[$row][2] == 'user_email' ) {
    				$data.= '"' . $user->user_email . '",';
    			//start modifying
    			} elseif( $wpmem_fields[$row][2] == 'user_url' ) {
    				$data.= '"' . esc_url($user->user_url) . '",';
    			//end modifying
    			} else {
    				$data.= '"' . get_user_meta( $user->ID, $wpmem_fields[$row][2], true ) . '",';
    			}

    Then, go to line 195 and replace

    if( $wpmem_fields[$row][2] == 'user_email' ) {
    				$data.= '"' . $user->user_email . '",';
    			} else {
    				$data.= '"' . get_user_meta( $user->ID, $wpmem_fields[$row][2], true ) . '",';
    			}

    with

    if( $wpmem_fields[$row][2] == 'user_email' ) {
    				$data.= '"' . $user->user_email . '",';
    			//start modifying
    			} elseif( $wpmem_fields[$row][2] == 'user_url' ) {
    				$data.= '"' . esc_url($user->user_url) . '",';
    			//end modifying
    			} else {
    				$data.= '"' . get_user_meta( $user->ID, $wpmem_fields[$row][2], true ) . '",';
    			}

    This should do it.

    Also, in order for that f&*(*^&T Excel to properly open UTF-8 encoded csv files, you should add
    echo "\xEF\xBB\xBF"; // UTF-8 BOM
    after declaring the file headers.

    Plugin Author Chad Butler

    (@cbutlerjr)

    Somehow that got missed in the revised export process. Thanks for catching this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘empty user_url field in csv file’ is closed to new replies.