This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add "Email Us" link to footer | |
* | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/overriding-options-and-meta | |
*/ | |
function be_email_us() { | |
echo '<p><a href="mailto:' . 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