Site icon Hip-Hop Website Design and Development

Get present consumer array with submit string

I must get 10 present consumer fields and cross the sector values to a submit string. The submit string is anticipating sure label names for every worth.

Instance – submit string expects 'firstname' => 'worth', not 'user_firstname' => 'worth'. After days of deadly parse errors for syntax, now I simply get a fail standing. Both my array code or submit code, (or each), is in some way flawed. I learn a submit immediately from 2011 that claims since WordPress 3.3 (present model now could be 3.9), that the best way customized consumer fields are referred to as is totally different. The submit > http://goo.gl/x5deHi says the best way to name customized WP fields like 5 of mine are, is like this:

    if ( $current_user->has_prop( 'my-field' ) ) )
echo '<p>
    ' . $current_user->get( 'my-field' ) . '
    </p>';`

So that is the code I’ve proper now:

    //Get values for these 10 consumer fields 
    operate wp_get_current_user() {
    $current_user = wp_get_current_user();

    $current_user_info = array(
    'firstname' . $current_user->user_firstname =>' ',
    'lastname' .  $current_user->user_lastname =>' ',
    if ( $current_user->has_prop( 'mepr-address-one' ) ) )
    ' . $current_user->get( 'mepr-address-one' ) .  => ' ',
    if ( $current_user->has_prop( 'mepr-address-city' ) ) )
    ' . $current_user->get( 'mepr-address-city' ) .  => ' ',
    if ( $current_user->has_prop( 'mepr-address-state' ) ) )
    ' . $current_user->get( 'mepr-address-state' ) .  => ' ',
    if ( $current_user->has_prop( 'mepr-address-zip' ) ) )
    ' . $current_user->get( 'mepr-address-zip' ) .  => ' ',
    if ( $current_user->has_prop( 'mepr-address-country' ) ) )
    ' . $current_user->get( 'mepr-address-country' ) .  => ' ',   
    'e-mail' . $current_user->user_email =>' ',
    'username' . $current_user->user_login =>' ',
    'password' . $current_user->user_pass =>' '

    );
    }
    // Generate the POST string
    // These final three strains aren't posting my get consumer values
    $postdata = '';
    foreach($query_vals as $key => $worth){ 
$postdata .= $key.'='.urlencode($n=$worth).'&';
    }

And the submit string wants to satisfy the parameters described within the submit that’s this:

    foreach ( get_user_meta( $user->ID ) as $key => $values ) {
var_dump( $key, $values );
    }

However being a php newb, I am undecided of the coding syntax. Do not I’ve to outline has_prop earlier than I can use it?