Skip to content

Instantly share code, notes, and snippets.

View nefeline's full-sized avatar
:octocat:
Work, work!

Patricia Hillebrandt nefeline

:octocat:
Work, work!
View GitHub Profile
@nefeline
nefeline / tribe_change_url_text.php
Last active September 1, 2017 17:53
Change the calendar URL text
<?php
/**
* This function changes the label "Website:" to "Online Registration:".
*/
function tribe_change_url_text ( $translation, $text, $domain ) {
$custom_text = array(
'Website:' => 'Online Registration:'
);
if( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($translation, $custom_text) ) {
<?php
/**
* This snippet changes the default start and end times for both The Events Calendar and Community Events.
*/
function new_default_time( $default, $type ) {
if ( 'start' === $type ) {
return '09:00';
} elseif ( 'end' === $type ) {
return '22:00';
}
@nefeline
nefeline / functions.php
Last active January 17, 2019 20:53
Change the required fields in the Community Events submission form.
<?php
// Change the required fields in the Community Events form. This code is setting only the Event Title
// as a required field in the submission form. You can customize it the way you want.
// You will find the default event fields in the following link:
// https://theeventscalendar.com/knowledgebase/required-fields-for-events-submission-form/#default-fields
add_action( 'tribe_events_community_required_fields', 'my_community_required_fields' );
function my_community_required_fields( $required_fields ) {
<?php
// Do not load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( class_exists( 'Tribe__Extension__Settings_Helper' ) ) {
return;
}
/**
* Helper for inserting/removing fields on the WP Admin Tribe Settings pages
@nefeline
nefeline / gist:78246d43adcd1b90a31eafb5a5e17cbe
Last active August 17, 2017 14:53
Set email field as required
//This snippet sets the Organizer's name, e-mail and phone fields as required in Community Events Submission Form
add_filter( 'tribe_events_community_required_fields', 'require_organizer' );
function require_organizer( $fields ) {
if ( ! is_array( $fields ) ) {
return $fields;
}
$fields[] = 'organizer';
return $fields;
@nefeline
nefeline / remove_ical_export_links.php
Last active September 1, 2017 17:49
Removes the iCal and Google cal links from calendar
add_filter('tribe_events_community_section_before_organizer', 'add_text_organizer');
function add_text_organizer() {
echo '<div class="tribe-section-content"><h2>(click for full list)</h2></div>';
}
@nefeline
nefeline / changes_buy_now_button_text
Last active September 12, 2018 14:31
Changes Buy Now button text
/**
* Change the "Buy Now!" button text
*/
add_filter( 'tribe_tickets_buy_button', 'update_buy_now_button_text' );
function update_buy_now_button_text( $html ) {
$html = str_replace( "Buy Now!", "Register", $html );
@nefeline
nefeline / post_category_support.php
Created August 24, 2017 00:05
add support for post categories to tribe events
/* Tribe, add support for post categories */
add_filter('tribe_events_register_event_type_args', 'change_event_type_args');
function change_event_type_args ( $args ) {
$args['taxonomies'][] = 'category';
return $args;
}
@nefeline
nefeline / display_post_categories.php
Created August 24, 2017 00:19
Display Post Categories associated with CE at community/list
<?php
// Don't load directly
defined( 'WPINC' ) or die;
/**
* My Events Column for Category Display
*
* Override this template in your own theme by creating a file at
* [your-theme]/tribe-events/community/columns/category.php
*