Skip to content

Instantly share code, notes, and snippets.


Ben Racicot BenRacicot

View GitHub Profile

Keybase proof

I hereby claim:

  • I am benracicot on github.
  • I am benracicot ( on keybase.
  • I have a public key ASBKBJ2svvYhwpWSwq3bx57zse0eaexCiGJmKbK2GlPHpgo

To claim this, I am signing this object:

BenRacicot / .htaccess
Created Mar 7, 2018
Disaalow anyone except your network IP to access wp-admin login page (or any page) via .htaccess file
View .htaccess
# Only allow internal IP to access login page
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteCond %{REMOTE_ADDR} !^$
RewriteRule ^(.*)$ - [R=403,L]
BenRacicot / Plurilization of words
Created Jul 22, 2015
Found this code to pluralize words, nouns to be exact. It included some functions that where not defined so I've added the var 'last' to replace the original function that grabbed the last character.
View Plurilization of words
String.prototype.plural = function () {
// last character
var last = this.charAt(this.length-1);
if (this.last === 'y') {
if ( (this.charAt(this.length - 2)).isVowel() ) {
// If the y has a vowel before it (i.e. toys), then you just add the s.
return this + 's';
else {
BenRacicot / functions.php
Last active Aug 29, 2015
Extending WordPress Plugin DM Confirm Email
View functions.php
add_action( 'init', 'my_ajax_init' );
function my_ajax_init() {
add_action('wp_ajax_nopriv_create_user', 'create_user_function');
add_action('wp_ajax_create_user', 'create_user_function');
BenRacicot / functions.php
Last active Aug 29, 2015
PayPal IPN Script that creates a post in 'Orders_
View functions.php
// Add this code to functions.php to create a custom table to store order data.
// Use a CPT to create a post each time an order is made.
// require_once('order-post-type.php');
BenRacicot / enqueue_script.php
Last active Jan 3, 2016
Base AJAX Pagination code
View enqueue_script.php
// Base AJAX Pagination code
//Bad practice: // header.php
function custom_head(){
echo '<script type="text/javascript">var ajaxurl = \''.admin_url('admin-ajax.php').'\';</script>';