"Report an Accessibility Problem" Footer Link
Adds a small link at the bottom of every page inviting visitors to report accessibility barriers by email, with the page address filled in for you.
Opens WPIDE on
Code
// Email address (or contact page URL) for accessibility reports.
$wpide_a11y_contact = get_option( 'admin_email' );
add_action( 'wp_footer', function () use ( $wpide_a11y_contact ) {
$page = home_url( add_query_arg( array() ) );
if ( is_email( $wpide_a11y_contact ) ) {
$url = 'mailto:' . antispambot( $wpide_a11y_contact ) . '?subject=' . rawurlencode( 'Accessibility problem' ) . '&body=' . rawurlencode( "Page: $page\n\nWhat happened:\n" );
} else {
$url = add_query_arg( 'page_url', rawurlencode( $page ), $wpide_a11y_contact );
}
printf(
'<p class="wpide-a11y-report" style="text-align:center;font-size:14px;margin:1em 0;"><a href="%s">Report an accessibility problem on this page</a></p>',
esc_url( $url, array( 'mailto', 'http', 'https' ) )
);
}, 50 );
Notes
Change $wpide_a11y_contact to a dedicated inbox, or to the URL of a contact page.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.