Skip to content

Instantly share code, notes, and snippets.

View fjarrett's full-sized avatar

Frankie Jarrett fjarrett

View GitHub Profile

Keybase proof

I hereby claim:

  • I am fjarrett on github.
  • I am fjarrett (https://keybase.io/fjarrett) on keybase.
  • I have a public key whose fingerprint is AA2E 1FEB F6D8 B4EC 26EA 0B1B 83E3 667D 96AF 72ED

To claim this, I am signing this object:

@fjarrett
fjarrett / comments.php
Last active August 29, 2015 14:05
Generic comments template
<?php
if ( post_password_required() ) {
return;
}
?>
<div id="comments">
<?php if ( have_comments() ) : ?>
@fjarrett
fjarrett / wp-config.php
Last active November 15, 2017 06:21
Replacement wp-config.php file for WP project repos
<?php
/**
* This is a `wp-config.php` replacement file for WP project repositories.
*
* It's purpose is to allow WP configurations such as database credentials,
* auth salts and other constants to be environment-agnostic and live outside
* of version control and outside the `public_html` docroot.
*
* Place your environment-specific `wp-config.php` one level above the docroot
* in a `config` dir.
@fjarrett
fjarrett / .gitignore
Created August 9, 2014 19:17
Generic gitignore file for WP project repos
# Env files #
###################
/www/wp-content/uploads/*
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
@fjarrett
fjarrett / gist:e8cb7ee8a7012ec2ae7e
Created September 1, 2014 18:41
Alert original post author
<?php
function ataylorme_alert_original_author( $post_id ) {
// Skip post revisions
if ( wp_is_post_revision( $post_id ) ) {
return;
}
// Get post data
$post = get_post( $post_id );
@fjarrett
fjarrett / gist:b15788c0786bac78e0ba
Created September 8, 2014 20:36
Missouri Senator Roy Blunt's response to net neutrality
Dear Frankie,
Thank you for contacting me regarding net neutrality.
As you know, in 2010, the Federal Communications Commission (FCC)
established rules to regulate the Internet. The FCC claimed it could
regulate the Internet under the authority of its traditional telephone
regulations developed during the monopoly-era. A DC Circuit Court
recently struck down certain parts of these rules and decided the FCC
@fjarrett
fjarrett / gist:70d5ef34b527b54d1e7a
Created September 23, 2014 16:56
A Minimalist's Guide to WordPress Plugin Development
For some, the idea of writing a WordPress plugin is scary because there is so much that you can do with them, both good and bad. But plugins don't have to be complicated, there are some amazing things you can do with just a few lines!
In this session, we're going to examine just how simple a plugin can really be, and inspire one another to write more plugins, in less time, with less code.
@fjarrett
fjarrett / gist:12bd7b39b3efdd6d905e
Last active August 29, 2015 14:09
Stream record array filter example for John Sundberg
<?php
function bhww_filter_wp_stream_record_array( $recordarr ) {
if ( ! isset( $recordarr[0] ) ) {
return array();
}
// BackupBuddy (iThemes) entries
if (
'settings' === $recordarr[0]['connector']
@fjarrett
fjarrett / gist:2ecec35b53641e672743
Last active August 29, 2015 14:11
Custom user registration process
<?php
/**
* Process user registration
*
* A custom user registration process that listens for a
* specific type POST request that will create a new user
* on the blog.
*
* @action wp
@fjarrett
fjarrett / gist:1c122226e56e6f352b4e
Last active August 29, 2015 14:11
Custom user registration form
<form method="post">
<p>
<label for="user_login">Username</label>
<input type="text" name="user_login" id="user_login" placeholder="Username" required>
</p>
<p>
<label for="user_pass">Password</label>
<input type="password" name="user_pass" id="user_pass" minlength="12" placeholder="Password" autocomplete="off" required>