Skip to content
Docs
Get RestroPress

Action

rpress_user_dashboard_profile_form_fields

Updated
On this page

Fires inside the dashboard profile form, before the Save Changes button.

Runs in the profile form of the customer dashboard, just before the submit button, so extra inputs are posted with the form. Core handles the post on template_redirect at priority 5, checks its own nonce and redirects, so extension values must be read before that point.

Example#

function my_dashboard_profile_field() {
	$value = get_user_meta( get_current_user_id(), 'my_birthday', true );
	echo '<input type="date" name="my_birthday" value="' . esc_attr( $value ) . '">';
}
add_action( 'rpress_user_dashboard_profile_form_fields', 'my_dashboard_profile_field', 10, 0 );

Notes#

Core only saves its own profile fields; saving extra fields needs a callback that runs earlier than template_redirect priority 5 and verifies the rpress_account_hub_nonce field.

Source#

Fired from:

  • templates/rpress-user-dashboard.php (line 161)

See also#

Was this page helpful?