0
所以,我有我的wordpress網站形式如下:更新用戶的元數據
<?php
$current_user = wp_get_current_user();
?>
<div class="rh_contact_form">
<div class="mdl-textfield rhc_phone_number_class">
<?php if (is_user_logged_in()) { ?>
<?php echo '<input type="text" id="rhc_phone" name="rhc_phone" placeholder="Phone number" value="' .$current_user -> rh_phone. '"/>' ;?>
<?php }else{ ?>
<input class="mdl-textfield__input" type="text" id="rhc_phone" name="rhc_phone" placeholder="Phone number" value=""/>
<?php } ?>
</div>
<div class="rhc_ask">
<textarea class="mdl-textfield__input" type="text" rows= "3" id="rhc_ask" name="rhc_ask" placeholder="Ask seller"></textarea>
</div>
<input type="submit">Submit</input>
</div>
因此,有兩個用戶metakeys:rh_phone
和rh_ask
如何更新爲metavalue這兩個?
謝謝!