Skip to content

Instantly share code, notes, and snippets.

Josh Feck joshfeck

Block or report user

Report or block joshfeck

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
@joshfeck
joshfeck / csv_report_no_headings.php
Created Nov 14, 2019
Remove CSV report column headings. Event Espresso 4
View csv_report_no_headings.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_remove_labels_from_csv_column_headings(
$reg_csv_array,
$reg_row
) {
$i = 0;
foreach ($reg_csv_array as $key => $value) {
unset($reg_csv_array[$key]);
View disable_email_match.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
//* Disable email match check for logged out users
add_filter( 'EED_WP_Users_SPCO__verify_user_access__perform_email_user_match_check', 'ee_wp_users_remove_email_user_match_check_logged_out' );
function ee_wp_users_remove_email_user_match_check_logged_out() {
if ( ! is_user_logged_in() ) {
return false;
} else {
@joshfeck
joshfeck / remove_db_labels_example.php
Last active Oct 28, 2019
Remove database row labels from Regsitrations report CSV column headings
View remove_db_labels_example.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_remove_db_labels_from_csv_column_headings(
$reg_csv_array,
$reg_row
) {
foreach ($reg_csv_array as $key => $value) {
unset($reg_csv_array[$key]);
$new_key = preg_replace('/\[[^\]]*]/', '', $key);
@joshfeck
joshfeck / ee_ticket_list_shortcode.php
Last active Oct 28, 2019
Shortcode to print a list of ticket types and their number of tickets sold for one event. example usage: [ee_ticket_list_for_event id=40221]
View ee_ticket_list_shortcode.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_shortcode( 'ee_ticket_list_for_event', 'ee_ticket_list_for_event_shortcode' );
function ee_ticket_list_for_event_shortcode( $atts ) {
$atts = shortcode_atts( array(
'id' => 0
), $atts, 'ee_ticket_list_for_event' );
if($atts['id'] == 0){
return;
@joshfeck
joshfeck / cpt_archive_events_posts_orderby.php
Created Oct 21, 2019
Set /events/ archive to use WordPress defaults for posts orderby. Event Espresso 4
View cpt_archive_events_posts_orderby.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter('pre_get_posts', 'order_event_archive_by_wp_default');
function order_event_archive_by_wp_default($query) {
if ( $query->is_archive &&
isset($query->query['post_type']) &&
$query->query['post_type'] == 'espresso_events')
{
$CPT_Event_Strategy = EE_Registry::instance()->load_core('EE_CPT_Event_Strategy');
@joshfeck
joshfeck / add_user_cap.php
Last active Oct 7, 2019
Add a new capability to WP User account after they complete a registration for a specific event. Event Espresso 4
View add_user_cap.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE__EE_Transaction_Processor__update_transaction_and_registrations_after_checkout_or_payment',
'my_add_user_cap_for_event',
10,
2
);
@joshfeck
joshfeck / venue-location.php
Created Sep 30, 2019
Change "venue" to "location", and other variations of the term. Event Espresso 4
View venue-location.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter( 'gettext', 'ee_venue_filter_gettext', 10, 3 );
function ee_venue_filter_gettext( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
'Venue' => 'Location',
'Venue:' => 'Location:',
@joshfeck
joshfeck / conditional_question.php
Created Sep 25, 2019
An example that shows how to conditionally not include a registration form question when a specific ticket is in the cart. Event Espresso 4
View conditional_question.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'wp_enqueue_scripts', 'rc_ee_hide_custom_questions_convention', 99 );
function rc_ee_hide_custom_questions_convention() {
wp_add_inline_script(
'single_page_checkout',
'jQuery( document ).ready( function( $ ) {
if($("#spco-attendee_information-dv").find(".spco-attendee-ticket-910").length !== 0) {
$(".ee-reg-qstn-34-input-dv").hide();
@joshfeck
joshfeck / invoice_icon_remove.php
Created Sep 24, 2019
Remove the invoice icon from the actions column of the my events page. Event Espresso 4 + WP Users add-on
View invoice_icon_remove.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EES_Espresso_My_Events__actions',
'my_remove_invoice_from_column',
10,
2
);
function my_remove_invoice_from_column(
@joshfeck
joshfeck / stripe_order_description_example.php
Created Oct 3, 2018
Send a custom order description to Stripe that includes the primary attendee name and the event name. Event Espresso 4.
View stripe_order_description_example.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter( 'FHEE__EE_PMT_Stripe_Onsite__generate_new_billing_form__description',
'stripe_att_name_event_name_order_description', 10, 2
);
function stripe_att_name_event_name_order_description( $desc, $transaction ) {
$desc = 'Tickets';
if( $transaction instanceof EEI_Transaction ) {
$primary_registrant = $transaction->primary_registration();
You can’t perform that action at this time.