Skip to content

Instantly share code, notes, and snippets.

View taricco's full-sized avatar

Tim in Seattle taricco

  • Seattle, WA
View GitHub Profile
/* Place in functions.php - Notification name must match */
add_filter('gform_notification', 'change_notification_format', 10, 3);
function change_notification_format($notification, $form, $entry)
{
GFCommon::log_debug('gform_notification: change_notification_format() running.');
// Do the thing only for a notification with the name Text Notification
if ($notification['name'] == 'Admin Notification') {
GFCommon::log_debug('gform_notification: format changed to text.');
// Change notification format to text from the default html
function wsv_registration_page_redirect()
{
global $pagenow;
if (strtolower($pagenow) == 'wp-login.php' && strtolower($_GET['action']) == 'register') {
wp_redirect(home_url('/registration'));
}
}
add_filter('init', 'wsv_registration_page_redirect');
/* https://wordpress.org/plugins/public-post-preview/ */
add_filter('ppp_nonce_life', 'my_nonce_life');
function my_nonce_life()
{
return 60 * 60 * 24 * 14; // 14 days
}
/* https://wordpress.org/plugins/user-registration/ */
function ur_validate_user_email( $single_form_field, $data, $filter_hook, $form_id ) {
$value = isset( $data->value ) ? $data->value : '';
$blacklist = array( 'gmail.com', 'hotmail.com', 'outlook.com', 'aol.com', 'mail.com', 'yahoo.com', 'icloud.com' );
$parts = explode( '@', $value );
if( in_array( $parts[1], $blacklist ) ) {
/* https://wordpress.org/plugins/user-registration/ */
function ur_validate_user_email( $single_form_field, $data, $filter_hook, $form_id ) {
$value = isset( $data->value ) ? $data->value : '';
$whitelist = array( 'domain1.com', 'domain2.com', 'domain3.com' );
$parts = explode( '@', $value );
if( ! in_array( $parts[1], $whitelist ) ) {
/* https://wordpress.org/plugins/matchheight/ */
Columns: .wsv-match-height .fl-col-content
PowerPack Info Box: .wsv-match-height .pp-infobox
Ultimate Beaver Posts: .wsv-match-height .uabb-blog-posts
Posts Grid: .wsv-match-height .fl-post-grid-post
# ----------------------------------------------------
# | HTACCESS for WordPress on NameHero |
# | Version: 09/27/24 WWW |
# ----------------------------------------------------
# BEGIN Force SSL
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} !^www\.
/* Load on WordPress editor page */
<script type="text/javascript">
<!--//--><![CDATA[//><!--
var images = new Array()
function preload() {
for (i = 0; i < preload.arguments.length; i++) {
images[i] = new Image()
images[i].src = preload.arguments[i]
}
}
/* https://wordpress.org/plugins/download-manager/ */
[wpdm_category id="one-page-plans" cols="1" toolbar=0 item_per_page=5 template="link-template-wsv.php" order_by="title" order="desc" paging="0"]
/* Put in /theme-directory/download-manager/link-templates/link-template-wsv.php */
<!-- WPDM Link Template: Card -->
<div style="padding-bottom: 10px;">
<strong>[title]</strong><br />
<a href="[download_url]">Download</a>
function menu_item_text( $menu ) {
$menu = str_ireplace( 'Downloads', 'Materials', $menu );
return $menu;
}
add_filter('gettext', 'menu_item_text');
add_filter('ngettext', 'menu_item_text');