Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Forked from billerickson/functions.php
Created August 18, 2012 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpsmith/3383854 to your computer and use it in GitHub Desktop.
Save wpsmith/3383854 to your computer and use it in GitHub Desktop.
Add "Email Us" link to footer
<?php
/**
* Add "Email Us" link to footer
*
* @author Bill Erickson
* @author Travis Smith (modified)
* @link http://www.billerickson.net/overriding-options-and-meta
*/
function be_email_us() {
echo '<p><a href="mailto:' . htmlentities( get_option( 'admin_email' ) ) . '">Email Us</a></p>';
}
add_action( 'wp_footer', 'be_email_us' );
/**
* Modify Author Email option on Single Posts
*
* @author Bill Erickson
* @link http://www.billerickson.net/overriding-options-and-meta
*
* @param string $email
* @return string
*/
function be_post_author_email( $email ) {
global $post;
if( is_single() )
$email = get_the_author_meta( 'user_email', $post->post_author );
return $email;
}
add_filter( 'pre_option_admin_email', 'be_post_author_email' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment