TransWikia.com

Add custom field address_3 before city in user profile

WordPress Development Asked by Velphia on November 9, 2021

I have a little question, I managed to create a new field in the administration user but I would like to display it between address 2 and the city and I do not see how to do it, can you help me?

In functions.php I put that:

add_action( 'show_user_profile', 'extra_user_profile_fields' );
add_action( 'edit_user_profile', 'extra_user_profile_fields' );

function extra_user_profile_fields( $user ) { ?>

    <table class="form-table">
    <tr>
        <th><label for="address"><?php _e("Address 3"); ?></label></th>
        <td>
            <input type="text" name="address_3" id="address_3" value="<?php echo esc_attr( get_the_author_meta( 'address_3', $user->ID ) ); ?>" class="regular-text" /><br />
        </td>
    </tr>
    </table>
<?php }

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP