groundhogg/preferences/profile_form

πŸ“… Published on

πŸ“ Last updated

Documentation

Β»

Action Hooks

Β»

groundhogg/preferences/profile_form

Fires inside the profile form on the Groundhogg preferences page, after the built-in fields. Use this to add custom fields that contacts can update from the front end.

do_action( 'groundhogg/preferences/profile_form' );

This hook has no arguments. Use get_current_contact() to access the contact.

Example

add_action( 'groundhogg/preferences/profile_form', 'my_extension_add_company_field' );

/**
 * Add a company name field to the preferences profile form.
 *
 * @return void
 */
function my_extension_add_company_field() {
    $contact = \Groundhogg\get_current_contact();
    $value   = $contact ? esc_attr( $contact->get_company() ) : '';

    echo 'Company';
    echo '';
}

Was this helpful?

Let us know if this document answered your question. That’s the only way we can improve.