This file contains hidden or 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 | |
/* | |
Plugin Name: Customizations for My Awesome Site | |
Plugin URI: https://example.com/about/ | |
Description: Private customizations for my site. | |
Author: Me McWebmaster | |
Version: 1.0 | |
Author URI: https://example.com/ | |
*/ |
This file contains hidden or 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 | |
/* | |
Plugin Name: Customizations for My Awesome Site | |
Plugin URI: https://example.com/about/ | |
Description: Private customizations for my site. | |
Author: Me McWebmaster | |
Version: 1.0 | |
Author URI: https://example.com/ | |
*/ |
This file contains hidden or 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 # Ignore this line when inserting this code into `wp-config.php`. | |
# Get the current month. | |
$month = date('n'); | |
# Determine which quarter of the year we are in. | |
if ( 4 > $month ) { | |
$quarter = 1; | |
} elseif ( 4 <= $month && 7 > $month ) { | |
$quarter = 2; |
This file contains hidden or 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 | |
/** | |
* Genericize login error messages | |
*/ | |
function brazenly_genericize_login_errors( $error ) { | |
$new_message = 'The credentials provided are incorrect.'; | |
$error = str_replace( 'Invalid username.', $new_message, $error ); | |
$error = preg_replace( '{The password you entered for the username <strong>.*</strong> is incorrect\.}', $new_message, $error ); |
This file contains hidden or 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
/** | |
* Sitename shortcode | |
*/ | |
add_shortcode( 'sitename', function() { return get_bloginfo(); } ); |
This file contains hidden or 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
/** | |
* Register deleting spam on a daily basis | |
*/ | |
function brazenly_activate_spam_cleaning() { | |
if ( ! wp_next_scheduled( 'brazenly_deleting_spam' ) ) | |
wp_schedule_event( time(), 'twicedaily', 'brazenly_deleting_spam' ); | |
} | |
add_action( 'wp', 'brazenly_activate_spam_cleaning' ); |
This file contains hidden or 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
/** | |
* Fetch & cache Gravatar profile information for commenters | |
*/ | |
function brazenly_get_social_info( $data = false ) { | |
$email_hash = md5( strtolower( trim( get_comment_author_email() ) ) ); # Get the hash of comment author's email | |
$transient = 'brazenly-social-' . $email_hash; # Our cache/transient ID | |
# Check if our data is cached; otherwise, pull new from Gravatar | |
if ( false === ( $gravatar_profile = get_transient( $transient ) ) ) { |
This file contains hidden or 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
.comment_author_about { | |
color: #888; | |
display: block; | |
margin-left: 1em; | |
} | |
.comment_author_accounts { | |
display: block; | |
margin-left: 1em; | |
} |