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
/** Filter out spam messages on Gravity Forms using the Comment Blacklist | |
* | |
* @author Best Website | |
* @link https://bestwebsite.com/ | |
* | |
* Usage: Add spammy terms to Settings > Discussion > Disallowed Comment Keys to block form submissions | |
* | |
* @param string $is_spam, true if entry contains spam | |
* @param array $form | |
* @param array $entry |
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_filter( 'gettext', 'bw_rename_coupon_field_on_cart', 10, 3 ); | |
add_filter( 'woocommerce_coupon_error', 'bw_rename_coupon_label', 10, 3 ); | |
add_filter( 'woocommerce_coupon_message', 'bw_rename_coupon_label', 10, 3 ); | |
add_filter( 'woocommerce_cart_totals_coupon_label', 'bw_rename_coupon_label',10, 1 ); | |
add_filter( 'woocommerce_checkout_coupon_message', 'bw_rename_coupon_message_on_checkout' ); | |
function bw_rename_coupon_field_on_cart( $translated_text, $text, $text_domain ) { | |
// bail if not modifying frontend woocommerce text |
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
add_image_size( 'bestwebsite-admin-post-featured-image', 120, 120, false ); | |
// Add the posts and pages columns filter. They can both use the same function. | |
add_filter('manage_posts_columns', 'bestwebsite_add_post_admin_thumbnail_column', 2); | |
add_filter('manage_pages_columns', 'bestwebsite_add_post_admin_thumbnail_column', 2); | |
// Add the column | |
function bestwebsite_add_post_admin_thumbnail_column($bestwebsite_columns){ | |
$bestwebsite_columns['bestwebsite_thumb'] = __('Featured Image'); | |
return $bestwebsite_columns; |
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 this to your functions.php file to change all occurrences of the word 'Welcome' to 'Good Morning' in page content when viewed before 11am | |
function replace_text_based_on_time($content) | |
{ | |
//get current time - site time | |
$current_site_time = current_time('mysql'); | |
//split the time string and get a time | |
$current_site_time = explode(' ', $current_site_time); | |
$current_site_time = explode(':', $current_site_time[1]); |
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
remove_action( 'admin_notices', 'woothemes_updater_notice' ); |
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
add_filter('gettext', function($text){ | |
if(in_array($GLOBALS['pagenow'], array('wp-login.php'))){ | |
if('Username' == $text){ | |
return 'Email'; | |
} | |
} | |
return $text; | |
}, 20); |
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
add_filter('authenticate', function($user, $email, $password){ | |
//Check for empty fields | |
if(empty($email) || empty ($password)){ | |
//create new error object and add errors to it. | |
$error = new WP_Error(); | |
if(empty($email)){ //No email | |
$error->add('empty_username', __('<strong>ERROR</strong>: Email field is empty.')); | |
} |
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
remove_filter('authenticate', 'wp_authenticate_username_password', 20); |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>bwCounter HTML and JavaScript Timer</title> | |
<script type="text/javascript"> | |
/************************************** | |
* bwCounter script by bestwebsite.com * | |
**************************************/ | |
function bwCounter(initDate,id){ | |
this.beginDate = new Date(initDate); |
NewerOlder