This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_footer', function() { | |
// Stop if we're not on the community edit event page | |
if ( ! tribe_is_community_edit_event_page() ) { | |
return; | |
} | |
?> | |
<script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'the_title', function( $title, $id ) { | |
if ( 0 === $id && 'Untitled' === $title ) { | |
$title = ''; | |
} | |
return $title; | |
}, 11, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Might be overengineering this with the str_contains polyfill | |
// Just checking to see if the string contains "events/feed" before returning null | |
// @link https://www.php.net/manual/en/function.str-contains.php#Hcom126277 | |
// @link https://developer.wordpress.org/reference/functions/get_post_type_archive_link/ | |
if ( ! function_exists( 'str_contains' ) ) { | |
function str_contains( string $haystack, string $needle ) { | |
return empty( $needle ) || strpos( $haystack, $needle ) !== false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'template_redirect', function() { | |
if ( is_user_logged_in() ) { | |
return; | |
} | |
if ( | |
tribe_is_event() || | |
tribe_is_event_category() || | |
tribe_is_in_main_loop() || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'tribe_events_community_required_fields', function( $fields ) { | |
$fields[] = 'tax_input.tribe_events_cat'; | |
return $fields; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_footer', function() { | |
// Replace with your own Page ID. | |
// Reference: https://developer.wordpress.org/reference/functions/is_page/ | |
if ( is_page( 2 ) ) : | |
?> | |
<script> | |
(function () { | |
const dates = document.querySelectorAll( '.tribe-events-calendar-day__event-datetime .tribe-event-date-start' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_footer', function() { | |
$args = [ | |
'start_date' => 'now', | |
'posts_per_page' => 10, | |
'post_status' => 'publish', | |
]; | |
$events = tribe_get_events( $args ); | |
foreach ( $events as $key => $event ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_footer', function() { ?> | |
<script> | |
(function () { | |
const dates = document.querySelectorAll( '.tribe-events-calendar-day__event-datetime .tribe-event-date-start' ); | |
if ( ! dates ) { | |
return; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'tribe_event_featured_image_size', function() { | |
return 'large'; | |
} ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Use at your own risk! | |
// No warranty, no support provided | |
// There are performance implications of querying more posts than your database server can handle | |
add_filter( 'tribe_widget_args_to_context', function( $alterations, $arguments ) { | |
// Is this the Events List widget? | |
if ( 'tribe-widget-events-list' === $arguments['widget_obj']->id_base ) { | |
// Adjust number of events displayed here. | |
$alterations['events_per_page'] = 99; |