Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@joshfeck
joshfeck / yoast_seo_boxes.php
Created April 13, 2020 16:13
Activate Yoast SEO plugin's meta box on Event Espresso CPT editor routes.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action('plugins_loaded', 'my_ee_yoast_seo_box');
function my_ee_yoast_seo_box() {
if (
! empty($_GET['page'])
&&
in_array(
@joshfeck
joshfeck / line_item_display_spco.php
Created April 9, 2020 19:00
A simple and quick example of how to use filter hooks to customize the registration checkout display under the "Name and Description" column. Event Espresso 4.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EE_Default_Line_Item_Display_Strategy__item_row__name',
function($name, $line_item) {
return $line_item->ticket_event_name() . '<br>';
},
10,
2
@joshfeck
joshfeck / exclude_venue_calendar.php
Created April 1, 2020 21:40
Exclude events with venue identifier "online" from being displayed in the EE4 calendar
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EED_Espresso_Calendar__get_calendar_events__query_params',
'my_exclude_online_venue_calendar_filter',
10,
7
);
@joshfeck
joshfeck / ics_virtual_location.php
Last active March 28, 2020 15:05
Add iCalendar "Conference" property to generated ics file. Event Espresso 4
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EED_Ical__download_ics_file_ics_data',
'my_custom_ics_virtual_location',
10,
2
);
@joshfeck
joshfeck / ticket_selector_add_to.php
Last active April 13, 2020 14:50
Add a tickets remaining column to the Event Espresso ticket selector. Requires displaying ticket selector details section.
<?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', 'my_add_inline_script_ts_show_sale_info', 20);
function my_add_inline_script_ts_show_sale_info() {
$custom_js = '
jQuery(document).ready(function($){
$(".ee-ticket-selector-ticket-details-th").after("<th class=\'cntr\' scope=\'col\'>Tickets Remaining</th>");
$("td[data-th=\'Remaining\']").each(function() {
$(this).clone().insertAfter(
@joshfeck
joshfeck / admin_reg_page.php
Created March 7, 2020 02:37
Example code for adding to the Event Espresso 4 Registrations admin list table
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE__admin_wrapper__template__before_admin_page_content',
'my_custom_add_to_admin_reg_list_table'
);
function my_custom_add_to_admin_reg_list_table() {
$currentScreen = get_current_screen();
if(
@joshfeck
joshfeck / select.css
Created March 6, 2020 22:10
Override Astra theme's minimal styles for html select input
.ticket-selector-tbl-qty-slct {
display: inline-block;
font-size: 16px;
font-weight: 700;
color: #444;
line-height: 1.3;
padding: .6em 1.4em .5em .8em;
max-width: 100%;
box-sizing: border-box;
margin: 0;
@joshfeck
joshfeck / date_time_formats.php
Last active March 5, 2020 16:03
Example code that shows how to change the date & time format for the Event Espresso 4 event editor date & time inputs
<?php
//* Please do NOT include the opening php tag, except if you're starting with a blank file
function ee_change_dt_formats($formats) {
return array(
'date' => 'd.m.Y',
'time' => 'H:i'
);
}
add_filter(
@joshfeck
joshfeck / venue_after_dates.php
Created February 14, 2020 22:45
Display venue City, State/Province, Country on the event list page, after the dates
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE_event_details_after_event_date',
'my_custom_venue_details_for_event_list'
);
function my_custom_venue_details_for_event_list($post) {
if(is_archive()) {
add_filter(
@joshfeck
joshfeck / espresso_txn.php
Created February 14, 2020 13:56
Example showing how to add custom CSS to the Event Espresso Transactions admin page
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'admin_enqueue_scripts',
'my_custom_txn_table_column_widths',
20
);
function my_custom_txn_table_column_widths() {
$css =