Skip to content

Instantly share code, notes, and snippets.

View eirichmond's full-sized avatar

Elliott Richmond eirichmond

View GitHub Profile
@eirichmond
eirichmond / bot_register.php
Created April 27, 2014 08:21
Reduce bot registration for WordPress
//1. Add a new form element...
add_action('register_form','erwp_register_form');
function erwp_register_form (){
$spam = ( isset( $_POST['fooey'] ) ) ? $_POST['fooey']: '';
?>
<input type="text" name="fooey" value="<?php echo esc_attr(stripslashes($spam)); ?>" style="display: none;" />
<?php
}
//2. Add validation. In this case, we make sure fooey is empty.
<?php
/*
Plugin Name: ER Post Password Expires
Plugin URI: https://squareone.software
Description: Sets the expiration of a post/page password protected page
Version: 1.0.0
Author: Elliott Richmond
Author URI: https://squareone.software
Text Domain: er-post-password-expires
<?php
/* a couple of filters to remove elements from titles */
add_filter( 'get_the_archive_title', 'wptv_remove_title_elements', 10, 1);
function wptv_remove_title_elements($title) {
if ( is_category() ) {
$title = single_cat_title( '', false );
}
return $title;
@eirichmond
eirichmond / installapps.sh
Last active February 24, 2020 16:39
Critical Recover Application Install brew script
#!/bin/bash
# Update any existing home-brew recipes
brew update
# Upgrade any already installed formulae
brew upgrade
# Install my brew packages
brew install wget
@eirichmond
eirichmond / wpinstall.sh
Created February 6, 2020 15:06
WordPress Install with wp-cli
#!/bin/bash
# download the core
wp core download --locale=en_GB
# setup the wp-config
read -p "DB Name?: " -e DBNAME
read -p "DB Password?: " -e DBPASS
read -p "DB Prefix?: " -e DBPREFIX