Skip to content

Instantly share code, notes, and snippets.

🏖
Santa Monica WordPress Developer

Austin Passy thefrosty

🏖
Santa Monica WordPress Developer
Block or report user

Report or block thefrosty

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
@thefrosty
thefrosty / mailhog-mamp.md
Created Jun 27, 2018 — forked from jaredatch/mailhog-mamp.md
Install MailHog with MAMP Pro
View mailhog-mamp.md

Install MailHog with MAMP Pro, using HomeBrew.

MailHog

First let's make sure HB is updated. Open up terminal for the following steps.

$ brew update
@thefrosty
thefrosty / wp-rest-api-cache.php
Created Feb 1, 2018
WpRestApiCache Controller
View wp-rest-api-cache.php
<?php
/**
* WpRestApiCache Controller.
* This file extend the wp-rest-api-cache plugin that allows filtering of
* cache depending on conditions met.
*
* @package BeachbodyOnDemand\WpRestApiCache
*/
namespace BeachbodyOnDemand\WpRestApiCache;
@thefrosty
thefrosty / Add2faMetaBox.php
Created May 4, 2017
Dovedi and WP User Profiles support.
View Add2faMetaBox.php
<?php
namespace Dwnload\Plugins\Dovedi;
/**
* Class Add2faMetaBox
*
* @package Dwnload\Plugins\Dovedi
*/
class Add2faMetaBox {
@thefrosty
thefrosty / plugins-loader.php
Last active Feb 7, 2017
Enables the loading of plugins not sitting in the mu-plugins directory to allow auto-updates and correct directory reads.
View plugins-loader.php
<?php
/**
* Plugin Name: Autoload Plugins
* Plugin URI: https://gist.github.com/thefrosty/8303566
* Description: Autoload non-MU plugins that live in the `wp-content/plugins` directory. This allows auto-updates to
* work but have to plugin act like an must-use plugin.
* Version: 0.2.1
* Author: Austin Passy
* Author URI: http://austin.passy.co/
*/
@thefrosty
thefrosty / wp-cl-customizer.php
Created Feb 22, 2016
Basic WordPress customizer setting.
View wp-cl-customizer.php
<?php
namespace Passy;
add_action( 'customize_register', __NAMESPACE__ . '\\customize_register' );
function customize_register( WP_Customize_Manager $wp_customize ) {
$wp_customize->add_panel( 'custom_login_settings',
array(
@thefrosty
thefrosty / .htaccess
Created Jan 21, 2014
Can't seem to get this to work. Want all WordPress media files to point to the new Multisite install folder.
View .htaccess
RewriteRule ^/wp-content/uploads/([0-9]{4})/([0-9]{2})/(.*)$ http://sub.domain.com/wp-content/uploads/sites/2/$1/$2/$3 [L,R=301]
@thefrosty
thefrosty / Get emails from a page.
Created May 24, 2013
I used this to scrape emails from a BuddyPress pending approvals page to email all users to verify non-spam.
View Get emails from a page.
var Values = [];
jQuery('#pw_pending_users a[href^="mailto:"]').each(function() {
var $this = jQuery(this);
Values.push($this.text());
});
console.log(Values.join(', '));
View gist:5496695
<?php
/*
Plugin Name: Easy Digital Downloads - Variable Pricing License Activation Limits
Plugin URL: http://easydigitaldownloads.com/extension/
Description: Limit the number of license activations permitted based on variable prices
Version: 1.0.3
Author: Pippin Williamson
Author URI: http://pippinsplugins.com
Contributors: mordauk
*/
@thefrosty
thefrosty / gist:5163269
Last active Dec 14, 2015
On each form submission I am saving an array in meta, and on form completion I am trying to update the meta. But since it's a multidimensional array I am trying to target only the current matching array to update "inactive" to "active". And a form completion might not be the last or current array. It could be completed at a later time.
View gist:5163269
<?php
function submit_form() {
$value = array(
'key' => '', // Array key?
'date' => date( get_option( 'date_format' ) . ' ' . get_option('time_format'), current_time( 'timestamp', 0 ) ),
'name' => $user_name,
'email' => $email,
'hash' => $hash,
'message' => esc_textarea( $_POST['commentText'] ),
@thefrosty
thefrosty / reset featured images
Last active Dec 11, 2015
Recently I accidentally set all posts featured image to the most recent uploaded image. Here is a snippet to fix it:
View reset featured images
You can’t perform that action at this time.