Skip to content

Instantly share code, notes, and snippets.

Arron Gibson infn8

Block or report user

Report or block infn8

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 acf-collapse-all.js
// paste into WP console in admin
jQuery(document).ready(function($) {
$('.acf-flexible-content .values .acf-icon.-collapse').click(function(e){
$this = $(this);
if(e.shiftKey) {
open = $'.-collapsed .-collapse');
console.log('shift clicked');
console.log('open: ', open);
if (open){
$all = $this.parentsUntil('.values').parent().find('.-collapsed .acf-icon.-collapse');
infn8 / functions.php
Created Mar 7, 2018
Show Bootstrap Sizers in Wordpress
View functions.php
function getBootstrapBreakpoints() {
return array(
infn8 / functions.php
Created Dec 8, 2016
Remove Paragraph Formating in Wordpress on a per post basis
View functions.php
// knock out default filter
// add NEW filter
function post_custom_formatting($content){
global $post;
// to remove the wpautop add a meta field to the post called 'wpautop' equal to 'false'
$nope = trim(get_post_meta( $post->ID, 'wpautop', true )) === 'false';
View cascade_values.fn.php
function cascade_values(){
for ($i = 0; $i < func_num_args(); $i++) {
$val = func_get_arg($i);
return $val;
return false;
infn8 / gist:be3edaa79aa40693983a
Created Mar 4, 2016
WP CLI add post from lorem ipsum API with author of first administrator.
View gist:be3edaa79aa40693983a
curl "" | sed "s/<\/p>/<\/p>\<\!\-\-more\-\-\>/" | wp post generate --post_content --count=1 --post_author=$(wp user list --role=administrator --field=ID --format=json | sed "s/\[//" | sed "s/\]//" | sed "s/\,.*//")
infn8 / functions.php
Created Feb 11, 2016
Add uStream oEmbed support to WordPress.
View functions.php
// Add this to your plugin file or to functions.php
function my_add_oembed_providers() {
wp_oembed_add_provider( '#http://(www\.)?*#i', '', true );
add_action( 'init', 'my_add_oembed_providers' );

Sublime Text Snippets and Keyboard shortcuts for working with Bootstrap

To install:

  • Toss all .sublime-snippet files into /Packages/User/ in your sublime install
  • Optional
    • Copy the lines from sample.sublime-keymap into your user keymap More Info Here

Tab Triggers

infn8 / functions.php
Last active Apr 5, 2018
Wordpress Bootstrap Image Sizes
View functions.php
function add_theme_features() {
// Add Image Sizes
$containerLG = 1170; // Change this if you have updated the largest bootstrap container width.
for ($i=1; $i <= 12; $i++) {
ceil($containerLG / 12 * $i),
ceil($containerLG / 12 * $i) * 10,
infn8 /
Last active Sep 30, 2019
Wp CLI New Wordpress Install
for ((i=1;i<=$#;i++));
if [ ${!i} = "--dbname" ]
then ((i++))
elif [ ${!i} = "--dbuser" ];
then ((i++))
infn8 / functions.smtp.php
Created Feb 25, 2015
Use Mandrill SMTP for WordPress wp_mail() function
View functions.smtp.php
/* Add this to your functions.php or plugin file */
add_action( 'phpmailer_init', 'configure_mandrill_smtp' );
function configure_mandrill_smtp( PHPMailer $phpmailer ){
$phpmailer->isSMTP(); //switch to smtp
$phpmailer->Host = '';
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 587;
$phpmailer->Username = 'MAILCHIMP_USER';
$phpmailer->Password = 'MAILCHIMP_API_KEY';
You can’t perform that action at this time.