Skip to content

Instantly share code, notes, and snippets.

Ryan Duff ryanduff

Block or report user

Report or block ryanduff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rewrite.php
<?php
add_filter( 'post_type_link', 'post_type_links', 10, 4 );
/**
* Generates custom permalink structures
*
* @since 1.0.0
*
* @param string $permalink Current permalink
* @param object $post Current post object
View term-edit.php
<?php
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'cmb_edit_term' );
function cmb_edit_term() {
echo '<article class="entry">';
$taxonomy_name = get_query_var( 'taxonomy_name', false );
View affwp-url-referral-var-shortcode.php
<?php
/*
Plugin Name: AffiliateWP Custom Referral URL
Plugin URI: http://affiliatewp.com
Description: Adds AffiliateWP Custom Referral URL
Version: 0.1
License: GPL
Author: AffiliateWP
*/
View keybase.md

Keybase proof

I hereby claim:

  • I am ryanduff on github.
  • I am ryanduff (https://keybase.io/ryanduff) on keybase.
  • I have a public key whose fingerprint is 0A3F C46B BDF0 CE47 EE47 A038 E2B7 70C3 8B97 1592

To claim this, I am signing this object:

@ryanduff
ryanduff / gist:9375808
Created Mar 5, 2014
Git workflow for checking remote prior to committing.
View gist:9375808
Before I make a commit on a repo that has a remote, I make sure to pull in any changes since prior to commiting goes as so:
1. Check for changes on the remote (a)
2. If no changes, skip to step 6. If there are changes continue
3. `git stash save`
4. `git pull`
5. `git stash apply`
6. Stage your changes and commit
7 `git push`
@ryanduff
ryanduff / gist:7681246
Created Nov 27, 2013
Deactivate plugins on each site in multisite. Drop in wordpress root directory. Assumes wp-config.php is in same directory. Props @kovshenin for the concept http://kovshenin.com/2012/how-to-network-deactivate-a-wordpress-plugin/
View gist:7681246
<?php
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
require( 'wp-config.php' );
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
global $wpdb;
$blogs = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs;" );
View gist:6285885
<?php
//USAGE
$semantics3 = biffleSemantics3::get_instance( $query );
$raw = $semantics3->get_product_search('products');
class biffleSemantics3 {
/*
Documentation
https://www.semantics3.com/docs/
View gist:6252657
<?php
function log_it( $logme ) {
$log = WP_CONTENT_DIR . '/log_it.log';
file_put_contents( $log, print_r( $logme, true ), FILE_APPEND );
}
View canttouchthis.php
<?php
function cant_touch_this() {
echo 'Stop, Hammer Time!';
}
add_action( 'init', 'cant_touch_this', (string) PHP_INT_MAX . rand(1, 1000) );
View gist:6065923
<?php
/**
* Infinite Scroll on the Homepage
*
* Display posts until the end of time
*
* @package WordPress
* @subpackage Lossip
* @since Lossip 1.0
*/
You can’t perform that action at this time.