Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Tony Warwick Pebblo

🏠
Working from home
  • Event Espresso
  • Liverpool, UK
Block or report user

Report or block Pebblo

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
View remove_accents_from_venue_slugs.php
<?php //Please do not include the opening PHP tag if you already have one.
// This function removes any accents set on the Venues slugs so they can be used within values URLs.
add_filter( 'FHEE__EE_Register_CPTs__get_CPTs__cpts', 'dre_modify_visibility_of_event_espresso_cpt_in_admin' );
function dre_modify_visibility_of_event_espresso_cpt_in_admin( $cpt_registry_array ) {
if ( isset( $cpt_registry_array['espresso_venues'] ) ) {
$cpt_registry_array['espresso_venues']['singular_slug'] = remove_accents($cpt_registry_array['espresso_venues']['singular_slug']);
$cpt_registry_array['espresso_venues']['plural_slug'] = remove_accents($cpt_registry_array['espresso_venues']['plural_slug']);
}
return $cpt_registry_array;
@Pebblo
Pebblo / display_next_upcoming_event.php
Last active Oct 11, 2019
A Shortcode to pull the next upcoming event and return 'Next course {start date} - Register'. You can set the category_slug parameter on the shortcode to pull a specific event category.
View display_next_upcoming_event.php
<?php // Please do not include the opening PHP tag if you already have one.
function display_next_upcoming_event( $attributes = array() )
{
$where_conditions = array(
'Datetime.DTT_EVT_start' => array( '>=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_start' ) )
);
if (! empty($attributes['category_slug']) ) {
$where_conditions['Term_Relationship.Term_Taxonomy.Term.slug'] = 'first';
@Pebblo
Pebblo / custom-functions-plugin.php
Created Oct 1, 2019
Example of a custom functions plugin
View custom-functions-plugin.php
<?php
/*
Plugin Name: Site plugin for corkandboardstudios.com
Description: Site specific code for corkandboardstudios.com
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */
// Disable email match check for all users
add_filter( 'EED_WP_Users_SPCO__verify_user_access__perform_email_user_match_check', '__return_false' );
View example.php
<?php
// Example of hot to change the 'Proceed to Finalize Registration' text depending on the cart total.
add_filter ( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_finalize_registration_button', 10, 2 );
function ee_finalize_registration_button( $submit_button_text, EE_Checkout $checkout ) {
if ( ! $checkout instanceof EE_Checkout || ! $checkout->current_step instanceof EE_SPCO_Reg_Step || ! $checkout->next_step instanceof EE_SPCO_Reg_Step ) {
return $submit_button_text;
}
if ( $checkout->next_step->slug() == 'finalize_registration' ) {
if ( $checkout->cart instanceof EE_Cart && $checkout->cart->get_cart_grand_total() != 0 ) {
View add_class_to_table_view_example.php
<?php // Please do not include the opening PHP tag if you already have one
function tw_ee_add_class_to_hidden_table_rows() {
wp_add_inline_script(
'espresso_events_table_template',
'jQuery(document).ready(function($){
$("#ee_filter_cat, #filter").change(function() {
let ee_filter_table_rows = $(".espresso-table-row");
// console.log(ee_filter_cat_id);
ee_filter_table_rows.each(function() {
@Pebblo
Pebblo / ical_organizer.php
Created Sep 23, 2019
Example of how to remove the ORGANIZER field from the ics.
View ical_organizer.php
<?php // Please do not include the opening PHP tag if you already have one.
function tw_ee_remove_organizer_from_ics($ics_data, $datetime) {
unset($ics_data['ORGANIZER']);
return $ics_data;
}
add_filter('FHEE__EED_Ical__download_ics_file_ics_data', 'tw_ee_remove_organizer_from_ics', 10, 2);
@Pebblo
Pebblo / example.php
Created Aug 19, 2019
How to change the 'No payments towards this transaction have been received.' on the thank you page
View example.php
<?php // Please do not include the opening PHP tag if you already have one
// Change the 'No payments towards this transaction have been received.' text shown on the thank you page.
add_filter( 'FHEE__payment_overview_template__no_payments_made', 'tw_ee_no_payments_made_text' );
function tw_ee_no_payments_made_text() {
return 'Your custom text here';
}
@Pebblo
Pebblo / tw_ee_check_all_checkboxes_for_primary_question_groups_on_create.php
Last active Aug 1, 2019
An example of how you can use jQuery to check all of EE's "Primary Registrant" questions groups when creating a new event. #EE #eventeditor #jquery
View tw_ee_check_all_checkboxes_for_primary_question_groups_on_create.php
<?php //Please do not include the opening PHP tag if you already have one
add_action(
'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__create_new',
'tw_ee_check_all_checkboxes_for_primary_question_groups_on_create'
);
function tw_ee_check_all_checkboxes_for_primary_question_groups_on_create() {
add_action(
'AHEE_event_editor_questions_notice',
'tw_ee_custom_checkboxes_for_primary_question_groups'
@Pebblo
Pebblo / tw_ee_filter_powered_by_event_espresso.php
Last active Aug 1, 2019
Example of how to change the EE admin foot text to include details from other plugins. #EE #admin_general
View tw_ee_filter_powered_by_event_espresso.php
<?php //Please do not include the opening PHP tag if you already have one.
//Remove the EE espresso_admin_footer callback and add another which includes current content.
add_action('admin_init', 'tw_filter_admin_footer_text');
function tw_filter_admin_footer_text() {
$admin = EE_Registry::instance()->load_core('EE_Admin');
remove_filter('admin_footer_text', array($admin, 'espresso_admin_footer'));
add_filter('admin_footer_text', 'tw_ee_filter_powered_by_event_espresso');
}
function tw_ee_filter_powered_by_event_espresso($content = '')
@Pebblo
Pebblo / ee_phone_input_validation.php
Created Jun 26, 2019
Example of how to override the validation stratey used on a EE_Phone_Input field.
View ee_phone_input_validation.php
<?php //Please do not include the opening PHP tag
add_filter('FHEE__EE_Form_Input_Base___construct__input_args', 'tw_ee_EE_Form_Input_Base___construct__input_args', 10, 2);
function tw_ee_EE_Form_Input_Base___construct__input_args( $input_args, $input ) {
if( $input instanceof EE_Phone_Input ) {
if( $input->has_validation_strategy('EE_Text_Validation_Strategy') ) {
$input->remove_validation_strategy('EE_Text_Validation_Strategy');
$input->add_validation_strategy(
new EE_Text_Validation_Strategy(
__('Please enter a valid phone number. Eg 123-456-7890 or 1234567890', 'event_espresso'),
You can’t perform that action at this time.