This file contains 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 | |
/** | |
* Hide 'expired' events from the /all/ recurring events view. | |
* | |
* This snippet is best added to a custom (mu-)plugin, for instance: | |
* | |
* wp-content/mu-plugins/ecp-customizations.php | |
* | |
* It is only intended as a temporary shim until a future version | |
* of The Events Calendar or Events Calendar PRO resolves things; |
This file contains 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 | |
/** | |
* Simple script to generate a bunch of randomish names, email addresses | |
* etc. Outputs CSV which can be piped into a file, etc. | |
* | |
* Adapt and modify as needed...remember there are more powerful tools out | |
* there for this sort of thing if you have more complicated needs: | |
* | |
* @see https://github.com/fzaninotto/Faker | |
* @see https://github.com/gevans/phaker |
This file contains 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( 'bbp_theme_after_topic_started_by', function() { | |
$topic = bbp_get_topic( bbp_get_topic_id() ); | |
if ( ! $topic || ! is_a( $topic, 'WP_Post' ) ) { | |
return; | |
} | |
try { | |
$date_created = date_create( $topic->post_date )->format( get_option( 'date_format' ) ); |
This file contains 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 | |
function community_events_12hr_time() { | |
return 'g:i a'; | |
} | |
function setup_time_option_filter() { | |
add_action( 'pre_option_time_format', 'community_events_12hr_time' ); | |
} | |
function teardown_time_option_filter() { |
This file contains 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 | |
/** | |
* Set the default comment status for events to 'closed'. | |
* | |
* Could easily be adapted to target all post types or a different | |
* post type. | |
*/ | |
add_filter( 'get_default_comment_status', function( $status, $post_type ) { | |
if ( 'tribe_events' !== $post_type ) { | |
return $status; |
This file contains 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 | |
function on_forum_post_status_transition( $new_status, $old_status, $post ) { | |
// If we are not looking at a reply or a topic, bail! | |
if ( ! bbp_is_topic( $post ) && ! bbp_is_reply( $post ) ) { | |
return; | |
} | |
$forum_id = bbp_get_forum_id( $post ); | |
$author_id = bbp_is_topic( $post ) | |
? bbp_get_topic_author_id( $post ) |
This file contains 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 a list of clickable category links below the event | |
* search bar. | |
* | |
* Can be easily styled using the following selector: | |
* | |
* .the-events-calendar-category-list | |
*/ | |
add_action( 'tribe_events_bar_after_template', function() { |
This file contains 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 custom templates for event views when specific categories | |
* have been requested. | |
*/ | |
class Event_Category_Templates { | |
/** | |
* This will be true if an event view has been requested. | |
* | |
* @var bool |
This file contains 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_tickets_plus_qr_check_security_code', '__return_true' ); |
This file contains 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 | |
# Quickly generate a set of test events on Eventbrite.com | |
# (from within a WordPress environment - useful for setting | |
# up test scenarios etc). | |
$token = '--YOUR-TOKEN-HERE--'; | |
$date = date_create( '2019-01-01 12:00:00' ); | |
for ( $i = 0; $i <= 60; $i++ ) { | |
$date->modify( '+2 days' ); |