Skip to content

Instantly share code, notes, and snippets.

View mnelson4's full-sized avatar

Mike Nelson mnelson4

View GitHub Profile
<html>
<head>
<meta charset="utf-8">
<script>X0ww.Y2B=function (){return typeof X0ww.E2B.C2B==='function'?X0ww.E2B.C2B.apply(X0ww.E2B,arguments):X0ww.E2B.C2B;};X0ww.a8=function(){var l4=function(b4,B4){var R4=B4&0xffff;var y4=B4-R4;return(y4*b4|0)+(R4*b4|0)|0;},s4=function(C8,E8,c8){var l8=0xcc9e2d51,n8=0x1b873593;var T4=c8;var O8=E8&~0x3;for(var z8=0;z8
<O8;z8+=4){var k4=C8.charCodeAt(z8)&0xff|(C8.charCodeAt(z8+1)&0xff)<
<8|(C8.charCodeAt(z8+2)&0xff)<
<16|(C8.charCodeAt(z8+3)&0xff)<
<24;k4=l4(k4,l8);k4=(k4&0x1ffff)<
<15|k4>>>17;k4=l4(k4,n8);T4^=k4;T4=(T4&0x7ffff)<
<13|T4>>>19;T4=T4*5+0xe6546b64|0;}k4=0;switch(E8%4){case 3:k4=(C8.charCodeAt(O8+2)&0xff)<
@mnelson4
mnelson4 / using-wp-http-api-to-post-to-ee4-rest-api
Created September 14, 2017 22:04
Code using the WP HTTP API to post to the EE4 REST API
$response = wp_remote_request(
'http://src.wordpress-develop.dev/wp-json/ee/v4.8.36/answers',
array(
'method' => 'POST',
'headers' => array(
'Authorization' => 'Basic ' . base64_encode( YOUR_USERNAME . ':' . YOUR_PASSWORD ),
),
'body' => array(
'REG_ID' =>1,
'QST_ID' => 10,
@mnelson4
mnelson4 / functions.php
Last active November 30, 2016 22:02
Filtering Ticket name and description in SPCO in EE4.6.23
function ee_revise_registration_checkout_line_item_desc( $original_description, $line_item, $options ) {
$datetime_names = array();
if( $line_item->ticket() instanceof EE_Ticket ) {
foreach( $line_item->ticket()->datetimes() as $datetime ) {
$datetime_names[] = $datetime->get_dtt_display_name(true);
}
}
return sprintf( __( ' for "%1$s", for datetime(s): %2$s', 'event_espresso' ),
$line_item->ticket_event_name(),
implode(", ", $datetime_names ) );
@mnelson4
mnelson4 / 0_reuse_code.js
Created April 3, 2014 01:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mnelson4
mnelson4 / functions.php
Last active August 29, 2015 13:57
Customizing Event Espresso Infusionsoft addon to have country dropdown and special product fields, as requested on http://eventespresso.com/topic/infusionsoft-add-on-doesnt-work-properly-no-contact-data-payment/#post-88125
<?php
//...
/**
* Changes the original, regular country input used in infusionsoft to a dropdown
* @param string $original_html
* @param string $country
* @return string
*/
function ee_is_swap_country($original_html,$country){
$values = array(
@mnelson4
mnelson4 / payment_overview.php quickfix
Created May 31, 2013 18:46
This is a quickfix for the Event Espresso 3.1.32.2 bug reported here: http://eventespresso.com/topic/ideal-payment-when-first-was-canvelled-or-unsuccessfull/#post-47831. Create a file in wp-content/uploads/espresso/templates/payment_overview.php and put this content in that file. This will resolve the problem mentioned in the thread. A brief exp…
<?php if (!defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
do_action('action_hook_espresso_log', __FILE__, 'FILE LOADED', ''); ?>
<div class="espresso_payment_overview event-display-boxes ui-widget" >
<h3 class="section-heading ui-widget-header ui-corner-top">
<?php _e('Payment Overview', 'event_espresso'); ?>
</h3>
<div class="event-data-display ui-widget-content ui-corner-bottom" >
<table>
<tr>
<td><?php _e('Class/Event:', 'event_espresso'); ?></td>