Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

  • gato-gordo
    Participant

    @gato-gordo

    Hey, thanks. That final solution sorts some more of the compound last names correctly, but takes people that have added a middle initial to their first name out of order. E.g., Linda C. Floyd gets sorted as a ‘C’.

    Does anyone know how to do this with the wp_usermeta.last_name or know why the code I posted breaks those functions?


    gato-gordo
    Participant

    @gato-gordo

    Thanks, in case people want to know what the query looks like for something like this:

    
    $query_string = $_SERVER['QUERY_STRING']; 
    
    if(isset($query_string)){
    
      parse_str($query_string, $query_array);
    		
      $letter = $query_array['Last_name_first_letter'];
    }
    
    if(isset($letter)){
      $the_field = xprofile_get_field_id_from_name('Last Name');
      $custom_ids = $wpdb->get_col("SELECT user_id FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = $the_field AND LEFT(value, 1) = '" . $letter . "' ");
    }
Viewing 2 replies - 1 through 2 (of 2 total)
Skip to toolbar