Skip to content

Email

An email address, such as the address of your support desk.

In the editor

An email field in the editor, with its placeholder and field style

Besides the settings every field shares, an email field has:

Setting What it does
Placeholder Grey text in the empty input.
Default value The address the option gets when you save the menu, as long as it has no value yet.
Field style The width of the input: Regular, Small, Large or Options.

On the options page

The email field on the options page

The input is an email input: the browser checks the address before the page is saved.

The value

Stores the address, cleaned with sanitize_email(). An address that is not valid becomes empty.

On your website

The shortcode and blocks show the address hidden from simple spam bots. With link="1" or a text, the shortcode makes it a mailto: link. Bound to the URL of a button, it becomes a mailto: link too.

[aop_option name="support_email" link="1"]

[aop_option name="support_email" text="Email us"]
$email = get_option( 'support_email' );

printf( '<a href="mailto:%1$s">%1$s</a>', esc_attr( antispambot( $email ) ) );