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 / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View eventbrite-attendees-shortcode-filters.php
<?php
/**
* Plugin Name: Eventbrite Attendees Shortcode - Filters
* Plugin URI: https://gist.github.com/thefrosty/4cc92703b5d2bc016901
* Description: Example filters for the <a href="http://wordpress.org/plugins/eventbrite-attendees-shortcode/">Eventbrite Attendees Shortcode</a>. Made for Phillip D. @ laeventco.com
* Author: Austin Passy
* Author URI: http://austin.passy.co
* Version: 2014.10.28
* License: GPL
View redirects.php
/**
* Function Name: front_end_login_fail.
* Description: This redirects the failed login to the custom login page
* instead of default login page with a modified url
*/
add_action( 'wp_login_failed', 'front_end_login_fail' );
function front_end_login_fail( $username ) {
$setting = class_exists( 'custom_login_pro_admin' ) ? get_option( CUSTOMLOGINPRO . '_settings' ) : get_option( CUSTOMLOGIN_PAGE_TEMPLATE()->id );
// Getting URL of the login page
@thefrosty
thefrosty / edd-fes.old.php
Created Aug 26, 2014
Check post type before modifying upload directory in EDD FES (v2.2.9.5).
View edd-fes.old.php
$override_default_dir = apply_filters('override_default_fes_dir', false );
if ( function_exists( 'edd_set_upload_dir' ) && !$override_default_dir ) {
add_filter( 'upload_dir', 'edd_set_upload_dir' );
}
else if ( $override_default_dir ){
add_filter( 'upload_dir', 'fes_set_custom_upload_dir' );
}
View gf-validate-edd-license-key.php
/**
* Validate a Gravity Forms license submission against EDD remote validation
*
* In Gravity Forms, for the text field you want to use as the license key entry,
* go to Advanced tab, check the "Allow field to be populated dynamically" checkbox,
* then enter the value as `edd-{download_id}`, where {download_id} is the, you guessed
* it, EDD Download ID.
*
* @param array $is_valid_and_form_array Gravity Forms passes an array with two keys: `is_valid` (boolean) and `form` (Gravity Forms form array)
* @return array Same format as incoming.
@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 / 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 / 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'] ),
You can’t perform that action at this time.