日韩伦理亚洲欧美在线一区_免费看一级大片_在线观看视频一区二区_日韩大片高清播放器大全






    WordPress后臺(tái)提供了個(gè)人信息的編輯,但是當(dāng)一個(gè)新用戶注冊(cè)的時(shí)候有可能會(huì)想要添加更多的個(gè)人信息,比如Web站點(diǎn)的URL,電話號(hào)碼,地址,性別等等,其實(shí)添加這些額外的字段都很簡(jiǎn)單。只需在functions.php添加一下代碼

    <?php
    add_action( 'show_user_profile', 'extra_user_profile_fields' );
    add_action( 'edit_user_profile', 'extra_user_profile_fields' );
    
    function extra_user_profile_fields( $user ) { ?>
    <h3><?php _e("Extra profile information", "blank"); ?></h3>
    
    <table class="form-table">
    <tr>
    <th><label for="address"><?php _e("Address"); ?></label></th>
    <td>
    <input type="text" name="address" id="address" value="<?php echo esc_attr( get_the_author_meta( 'address', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description"><?php _e("Please enter your address."); ?></span>
    </td>
    </tr>
    <tr>
    <th><label for="city"><?php _e("City"); ?></label></th>
    <td>
    <input type="text" name="city" id="city" value="<?php echo esc_attr( get_the_author_meta( 'city', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description"><?php _e("Please enter your city."); ?></span>
    </td>
    </tr>
    <tr>
    <th><label for="province"><?php _e("Province"); ?></label></th>
    <td>
    <input type="text" name="province" id="province" value="<?php echo esc_attr( get_the_author_meta( 'province', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description"><?php _e("Please enter your province."); ?></span>
    </td>
    </tr>
    
    
    <tr>
    <th><label for="postalcode"><?php _e("Postal Code"); ?></label></th>
    <td>
    <input type="text" name="postalcode" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'postalcode', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description"><?php _e("Please enter your postal code."); ?></span>
    </td>
    </tr>
    
    <tr>
    <th><label for="phone"><?php _e("Phone"); ?></label></th>
    <td>
    <input type="text" name="phone" id="phone" value="<?php echo esc_attr( get_the_author_meta( 'phone', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description"><?php _e("Please enter your phone number."); ?></span>
    </td>
    </tr>
    
    
    
    </table>
    <?php }
    
    add_action( 'personal_options_update', 'save_extra_user_profile_fields' );
    add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' );
    
    function save_extra_user_profile_fields( $user_id ) {
    
    if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
    
    update_user_meta( $user_id, 'address', $_POST['address'] );
    update_user_meta( $user_id, 'city', $_POST['city'] );
    update_user_meta( $user_id, 'province', $_POST['province'] );
    update_user_meta( $user_id, 'postalcode', $_POST['postalcode'] );
    update_user_meta( $user_id, 'phone', $_POST['phone'] );
    }
    ?>

     

    ? ? ? ? ? ? ? ? ? ? ? ?

    我們將在一個(gè)工作日內(nèi)聯(lián)系您

    ? ? ? ? ? ? ? ? ? ? ? ?

    免費(fèi)診斷您的獨(dú)立站及產(chǎn)品搜索量,制定您的海外營(yíng)銷計(jì)劃

    武汉市| 邛崃市| 长宁区| 永宁县| 闸北区| 灵宝市| 罗源县| 托克托县| 马山县| 彭阳县| 新龙县| 山西省| 黄山市| 自贡市| 西平县| 台中市| 英吉沙县| 岑溪市| 武夷山市| 汶上县| 甘肃省| 临泽县| 达拉特旗| 青浦区| 大关县| 永济市| 博爱县| 巩留县| 河源市| 永昌县| 桐城市| 卓资县| 台南市| 浦东新区| 信阳市| 浦城县| 通榆县| 澜沧| 灵寿县| 沭阳县| 鲁山县|