Skip to content

Instantly share code, notes, and snippets.

Shawn Hooper shawnhooper

Block or report user

Report or block shawnhooper

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
shawnhooper / tweetdeck-narrow-composer-bookmarklet.js
Created May 16, 2019
A bookmarklet to resize Tweetdeck's compose column after the May 2019 upgrade
View tweetdeck-narrow-composer-bookmarklet.js
View might-also-like.php
<div class="post-related col-xs-12 no-padding">
<div class="relatedposts col-md-10 col-md-offset-1">
<h3 class="relatedposts-title text-center">You might also like...</h3>
global $gemMightAlsoLike;
$recommended_posts = $gemMightAlsoLike->get_posts( get_the_ID() );
foreach ($recommended_posts as $recommended_post): ?>
<div class="relatedposts-item col-xs-12 col-sm-4 col-md-4">
View Update Core, Plugins & Themes - WP-CLI Demo Script
wp db export
wp core update
wp plugin update --all
wp theme update --all
View Create Base Site - WP-CLI Demo Script
wp core download --version=4.5
wp core config --dbname=$1 --dbuser=root --dbhost=
wp db create
wp core install --skip-email --title="$1" --admin_user="shawn" --admin_password="shawn" --url=
wp theme install simone --activate
wp plugin delete hello
wp plugin install any-ipsum;
wp plugin install advanced-custom-fields --version=4.4.0 --activate
wp plugin install tinymce-advanced --activate
shawnhooper / modify_rest_caps.php
Created Dec 2, 2015
Allow WordPress REST API to read a single post, by post status
View modify_rest_caps.php
add_filter( 'user_has_cap', array( __CLASS__, 'allow_rest_to_read_single_archived_module' ), 10, 3 );
* Modify the capabilities of the REST API to view a single
* "module" post if requested with its post ID.
* @param $allcaps
* @param $cap
* @param $args
View gist:45634ac1d1eebe74a2e0
Plugin Name: CLI Export Multisite
if ( ! defined( 'WP_CLI' ) ) return;
use \WP_CLI\Utils;
View gist:b15e65cc452752ef1de3
Plugin Name: CLI Export Multisite
if ( ! defined( 'WP_CLI' ) ) return;
use \WP_CLI\Utils;
View gist:a97ce0ec151a5a38822d
add_rewrite_rule('^workshops/([^/]+)(/[0-9]+)?/([^/]+)/([^/]+)', 'index.php?&workshop=$matches[4]&page=', 'top');
add_rewrite_rule('^workshops/([^/]+)(/[0-9]+)?/([^/]+)', 'index.php?pagename=workshops&cat=$matches[1]&subcat=$matches[3]', 'top');
add_rewrite_rule('^workshops/([^/]+)/?', 'index.php?pagename=workshops&cat=$matches[1]', 'top');
add_rewrite_tag('%subcat%', '([^&]+)');
shawnhooper / gist:9967205
Created Apr 4, 2014
Response to WordPress Stack Exchange : 140202
View gist:9967205
/*idea to develop further would be, add a text box that the user can input the quote in
this then gets added to the DB and passed to the $quotes array. From here the results get
output the same way*/
Plugin Name: Random Quotes
Plugin URI: xxx
Description: This Plugin randomly generates Quotes input by the user.
Version: 0.0.1
You can’t perform that action at this time.