Skip to content

Instantly share code, notes, and snippets.

Avatar
🏖️
Santa Monica WordPress Developer

Austin Passy thefrosty

🏖️
Santa Monica WordPress Developer
View GitHub Profile
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 / 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 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
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
@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
@thefrosty
thefrosty / edd-sl-upgrades.php
Created Nov 8, 2014
Upgrade a license to a higher sites count on Extendd.com for Easy Digital Downloads
View edd-sl-upgrades.php
<?php
if ( !defined( 'ABSPATH' ) )
exit;
function extendd_add_key_column() {
echo '<th class="edd_license_key_upgrade">' . __( 'Upgrade License', 'extendd' ) . '</th>';
}
add_action( 'edd_purchase_history_header_after', 'extendd_add_key_column' );
@thefrosty
thefrosty / edd-popular-downloads.php
Created Jan 23, 2015
Get popular downloads for recent XX days. Easy Digital Downloads.
View edd-popular-downloads.php
@thefrosty
thefrosty / ap-show-template.php
Last active Aug 29, 2015
Which WordPress tempalte are you currently one? http://wp.me/p4gJ2a-Be
View ap-show-template.php
function ap_show_template() {
// bail early
if ( is_admin() || !is_user_logged_in() )
return;
if ( !is_admin_bar_showing() || !current_user_can( 'edit_files' ) )
return;
global $template, $wp_admin_bar;
@thefrosty
thefrosty / admin.ajax.php
Created Mar 4, 2015
For testing perposes. This responds with 'heartbeat' when running. But when Clicking 'insert into post' or insert custom link (nav menu) among a few others the POST action never get's triggered. In my console I get 302 found, then a GET request to the home page. Example video: http://quick.as/1oovhyzj
View admin.ajax.php
if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) ) {
die($_POST['action']);
add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 );
}
@thefrosty
thefrosty / cron.class.php
Last active Aug 29, 2015 — forked from Jonathonbyrd/cron.class.php
Wordpress Cron Job Class. Makes Cronning a snap!
View cron.class.php
<?php
/**
* @Author Anonymous
* @link http://www.redrokk.com
* @Package Wordpress
* @SubPackage RedRokk Library
* @copyright Copyright (C) 2011+ Redrokk Interactive Media
*
* @version 0.1
*/
You can’t perform that action at this time.