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 | |
| function modify_organizer_type_properties( $properties ) { | |
| // Change the slug to "ponent" | |
| $properties['rewrite']['slug'] = 'ponent'; | |
| return $properties; | |
| } | |
| // Hook into the organizer type registration for Events Calendar Pro | |
| add_filter( 'tribe_events_register_organizer_type_args', 'modify_organizer_type_properties' ); |
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('init', function() { | |
| global $wpdb; | |
| // Title of the events to delete | |
| $event_title = 'Scrabble 1'; | |
| // Query to find events with the specified title | |
| $events = $wpdb->get_results( | |
| $wpdb->prepare( |
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
| function forcefully_publish_all_events() { | |
| global $wpdb; | |
| // Get all event IDs directly from the database | |
| $event_ids = $wpdb->get_col(" | |
| SELECT ID | |
| FROM {$wpdb->posts} | |
| WHERE post_type = 'tribe_events' | |
| AND post_status NOT IN ('publish') | |
| "); |
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 | |
| //* Do NOT include the opening php tag | |
| /** | |
| * If you want the BCC added to all ticket-related emails, regardless of type. | |
| * Useful for broader email handling, especially if your organization manages multiple ticket types. | |
| */ | |
| add_filter( 'tribe_tickets_email_headers', function( $headers, $ticket_id ) { |
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
| /** | |
| * Insert virtual event meeting URL and organizer link at the end of the description. | |
| * | |
| * @param array $item Array of items describing the event in ical format. | |
| * @param object $event The event object. | |
| * | |
| * @return array | |
| */ | |
| add_filter( 'tribe_ical_feed_item', function ( $item, $event ) { | |
| // Append virtual meeting URL if it exists |
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 //Do not copy this line | |
| add_filter( 'tribe_tickets_plus_attendee_registration_iac_fields', 'modify_attendee_fields' ); | |
| function modify_attendee_fields( $fields ) { | |
| // Check if 'Name' field exists before modifying | |
| if ( isset( $fields['name'] ) ) { | |
| $fields['name']['label'] = 'First Name'; // Change label to 'First Name' | |
| } | |
| // Optionally, you can add other modifications here |
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_filter( 'tribe_tickets_plus_attendee_registration_iac_fields', 'modify_attendee_fields' ); | |
| function modify_attendee_fields( $fields ) { | |
| // Check if 'Name' field exists before modifying | |
| if ( isset( $fields['name'] ) ) { | |
| $fields['name']['label'] = 'First Name'; // Change label to 'First Name' | |
| } | |
| // Optionally, you can add other modifications here | |
| // For example, changing placeholder text: |
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
| /** | |
| * Example for adding event data to WooCommerce checkout for Events Calendar tickets. | |
| * | |
| */ | |
| add_filter('woocommerce_cart_item_name', 'woocommerce_cart_item_name_event_title', 10, 3); | |
| function woocommerce_cart_item_name_event_title($title, $values, $cart_item_key) { | |
| // Check if the product is an Events Calendar ticket | |
| $product_id = isset($values['product_id']) ? $values['product_id'] : null; |
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 category to all events | |
| function add_category_to_all_events() { | |
| // Get all events | |
| $events = get_posts(array( | |
| 'post_type' => 'tribe_events', | |
| 'posts_per_page' => -1, // Get all events | |
| )); | |
| // Check if events are found | |
| if ($events) { |
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
| function custom_event_permalink_structure($permalink, $post, $leavename) { | |
| // Check if the post type is 'tribe_events' | |
| if ($post->post_type === 'tribe_events') { | |
| // Get the categories assigned to the event | |
| $categories = get_the_terms($post->ID, 'tribe_events_cat'); | |
| // Check if categories are available | |
| if ($categories && !is_wp_error($categories)) { | |
| $category = reset($categories); // Get the first category | |
| $category_name = $category->slug; |