Added manually for development purposes… how can I hook these into bb profile and save them from there? I have been working on this for 2 days with no success. At this point I can not change bbpress, I need a way to do this. Thanks in Advance.
add_action( 'show_user_profile', 'extra_user_profile_fields' );
add_action( 'edit_user_profile', 'extra_user_profile_fields' );
function extra_user_profile_fields( $user ) { ?>
<input type="text" name="address" id="address" value="ID ) ); ?>" class="regular-text" />
<input type="text" name="city" id="city" value="ID ) ); ?>" class="regular-text" />
<input type="text" name="province" id="province" value="ID ) ); ?>" class="regular-text" />
<input type="text" name="postalcode" id="postalcode" value="ID ) ); ?>" class="regular-text" />
< ?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'] );
}
-
This reply was modified 11 years, 11 months ago by robertFudge.
-
This reply was modified 11 years, 11 months ago by robertFudge.
-
This reply was modified 11 years, 11 months ago by robertFudge.
-
This reply was modified 11 years, 11 months ago by robertFudge.