Skip to content

Instantly share code, notes, and snippets.

View jeffaspenburg's full-sized avatar

Jeff Aspenburg jeffaspenburg

View GitHub Profile
<?php
/**
* Shortcode: EDD Product Version
*
* [edd_product_version]
* You can add id="post_id_here" to display the version number of a defined product.
*/
function shortcode_edd_product_version($atts) {
$atts = shortcode_atts(array(
@jeffaspenburg
jeffaspenburg / gist:991093782c15053454b110529a05fc12
Created August 27, 2021 19:14
Elementor Form Select - USA States Options
Alaska|AK
Alabama|AL
Arkansas|AR
American Samoa|AS
Arizona|AZ
California|CA
Colorado|CO
Connecticut|CT
District of Columbia|DC
Delaware|DE
@jeffaspenburg
jeffaspenburg / Google Sheets Multiple Sections
Created December 31, 2020 15:43
Google Sheets multiple sections separate by pipe
function onEdit(e) {
var oldValue;
var newValue;
var ss=SpreadsheetApp.getActiveSpreadsheet();
var activeCell = ss.getActiveCell();
if(activeCell.getColumn() == 15||16||17 && ss.getActiveSheet().getName()=='Insights') {
newValue=e.value;
oldValue=e.oldValue;
if(!e.value) {
activeCell.setValue("");
## Unordered List
<ul>
<li>List Item One</li>
<li>List Item Two</li>
<li>List Item Three</li>
</ul>
## Paragraph
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
@jeffaspenburg
jeffaspenburg / Instructions.md
Last active January 28, 2020 11:09
Elementor Call to Action Widget Variation

Elementor Custom CTA

This is a variation for Elementor Pro's Call to Action widget. A .json template is supplied to import to your website.

Requirements

Elementor Pro

Instructions

  1. Download the file titled "elementor-cta-variation-01.json"
  2. Log into your website
  3. Go to Templates > Saved Templates
@jeffaspenburg
jeffaspenburg / htaccess-wordpress-prod-images
Created August 9, 2019 02:05
WordPress htaccess Production to Local Media
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Pull Image Files From Live Server
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.*\.(png|jpe?g|gif|ico|svg)) https://production-site.com//$1 [NC,L]
RewriteRule ^index\.php$ - [L]
$user = new MeprUser($txn->user_id);
$args['subscription']['customer'] = array('email' => $user->user_email);
return $args;
}
//Commented out due to issues
//add_filter('mepr_authorize_create_subscription_args', 'add_email_to_recurring', 11, 3);
function add_email_to_oneoff($args, $txn) {
$user = new MeprUser($txn->user_id);
$args['x_email'] = $user->user_email;