Skip to content

Instantly share code, notes, and snippets.

@dazulu
dazulu / inclusive-design-summary.md
Last active July 11, 2017 07:11
Inclusive Web Design Summary

Inclusive Web Design Summary

This summary is an amalgamation of a few sources linked below and by no means an exhaustive authority. It should be treated as a developer guide and more detailed sources should be consulted when developing any web features. For example, the book and links mentioned below also include practical examples and more detail on ARIA roles and markup etc.

Define Page Language

Defining the correct language in an HTML page helps assistive technology to choose the correct voice profile or character set, besides the

@joshfeck
joshfeck / a-set-of-instructions.md
Last active November 30, 2016 22:20
Instructions on how to modify the EE Attendee Mover plugin's event selector to include day, month, and year of the events.

Step one

Set up a site specific plugin.

Step two

Add a /js/ folder to your plugin, then place the included custom-attendee-mover-event-selector.js file into that folder.

Step three

@joshfeck
joshfeck / add_location_to_calendar_tooltip.php
Created November 16, 2016 17:21
Adds the event location to the EE4 calendar tooltip. Requires EE4 and setting Display Attendee Limits to Yes in the calendar's Advanced Settings.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function jf_ee_add_location_to_calendar_qtip( $text, $datetime ) {
if ( $datetime instanceof EE_Datetime ) {
$event = $datetime->get_first_related( 'Event' );
if ( $event instanceof EE_Event ) {
$venue = $event->get_first_related( 'Venue' );
if ( $venue instanceof EE_Venue ) {
$venue_name = $venue->name();
@joshfeck
joshfeck / functions.php
Created November 15, 2016 17:20
This is an alternative way to display dates and times for the Event Espresso event page. Formats a single date time that spans multiple days as “Starts at <time> on <date> Ends at <time> on <date>”.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function espresso_list_of_event_dates( $EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL ) {
$date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
$time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' );
$date_format = apply_filters( 'FHEE__espresso_list_of_event_dates__date_format', $date_format );
$time_format = apply_filters( 'FHEE__espresso_list_of_event_dates__time_format', $time_format );
EE_Registry::instance()->load_helper( 'Event_View' );
$datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, $show_expired, FALSE, $limit );
@joshfeck
joshfeck / functions.php
Last active November 6, 2018 01:11
Example of how to conditionally hide/show a text question based on a drop down question value. Works with Event Espresso 4
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
// In this example the *text* question div class is .ee-reg-qstn-13-input-dv
// and the *dropdown* question input class is .ee-reg-qstn-12
function ee_custom_show_question_conditionally() {
wp_add_inline_script(
'ee_form_section_validation',
'jQuery( document ).ready(function($) {
@joshfeck
joshfeck / ee_display_ticket_selector_once.php
Created July 7, 2016 15:38
Sets the Event Espresso 4 ticket selector to display only one time if it's a single post. This is useful for custom placement of the ticket selector with a short code.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter( 'FHEE_disable_espresso_ticket_selector', 'ee_display_ticket_selector_once' );
function ee_display_ticket_selector_once() {
if( ! defined( 'TS_EXECUTED' ) ){
add_filter( 'FHEE_disable_espresso_ticket_selector', '__return_false' );
if ( is_single() ){
define( 'TS_EXECUTED', TRUE );
}
} else {
@Pebblo
Pebblo / functions.php
Created July 5, 2016 11:26
This filter returns and empty string for the '/ bundle' text displayed within the ticket selector.
<?php //Please do not include the opening php tag if you already have one
//Return an empty string for the 'bundle' text used within the ticket selector
function ee_tw_remove_bundle_text() {
return '';
}
add_filter( 'FHEE__ticket_selector_chart_template__per_ticket_bundle_text', 'ee_tw_remove_bundle_text' );
@Pebblo
Pebblo / functions.php
Last active March 4, 2019 14:30
An example of how to include conditional tags within the messages system
<?php
//Do not include the opening PHP tag if you already have one.
function tw_ee_register_template_shortcodes( $shortcodes, EE_Shortcodes $lib ) {
//Which sections of the messages system do we add the shrotcodes.
if ( $lib instanceof EE_Datetime_Shortcodes ||
$lib instanceof EE_Event_Shortcodes ||
$lib instanceof EE_Registration_Shortcodes ||
$lib instanceof EE_Transaction_Shortcodes ||
@Pebblo
Pebblo / content-espresso_my_events-event_section.template.php
Last active November 7, 2023 13:09
This template is used within the My Events section of the EE4 User Integration add-on, [ESPRESSO_MY_EVENTS]. Currently the original template will only display registrations that are assigned to the current users contact (registrations made using the same details). So if you place a group registration for 5 tickets and provide different details f…
<?php
/**
* Template for the "event_section" content template for the [ESPRESSO_MY_EVENTS] shortcode
*
* Available template args:
* @type EE_Event $event event object
* @type string $your_tickets_title title for the ticket.
* @type int $att_id The id of the EE_Attendee related to the displayed data.
*/
$registrations = $event->get_many_related('Registration', array( array( 'ATT_ID' => $att_id ) ) );
@Pebblo
Pebblo / functions.php
Created April 14, 2016 14:04
Example of how to display custom meta values just below the datetime list. 'testing_meta' will need to be the meta key you want to pull for the event.
<?php
//Example of how to display custom event meta just after the Datetime List section,
//this will be diplsayed on both the single event and event list sections.
function ee_event_meta_after_datetime_list( $post ) {
$event = EEM_Event::instance()->get_one_by_ID( $post->ID );
$event_meta = $event->get_post_meta( 'testing_meta' , true );
echo $event_meta;