Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- # Show custom user profile fields on User Page
- *
- # @param object $profileuser A WP_User object
- * @return void
- */
- function czystespalanie__extra_user_profile_fields( $user ) {
- ?>
- <h3><?php _e( 'Shipping information', 'czystespalanie'); ?></h3>
- <hr/>
- <table class="form-table">
- <tr>
- <th><label for="address"><?php _e( 'Address', 'czystespalanie' ); ?></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 />
- </td>
- </tr>
- <tr>
- <th><label for="city"><?php _e( 'City', 'czystespalanie' ); ?></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 />
- </td>
- </tr>
- <tr>
- <th><label for="postalcode"><?php _e( 'Zip code', 'czystespalanie' ); ?></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 code" />
- <br />
- </td>
- </tr>
- <tr>
- <th><label for="tel"><?php _e( 'Telephon', 'czystespalanie' ); ?></label></th>
- <td><input type="tel" name="tel" id="tel" value="<?php echo esc_attr( get_the_author_meta( 'tel', $user->ID ) ); ?>" class="regular-text code" />
- <br />
- </td>
- </tr>
- </table>
- <?php
- }
- add_action( 'show_user_profile', 'czystespalanie__extra_user_profile_fields', 10, 1 );
- add_action( 'edit_user_profile', 'czystespalanie__extra_user_profile_fields', 10, 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement