golden hour
/var/www/html/wp-content/plugins/the-events-calendar/src/Tribe
⬆️ Go Up
Upload
File/Folder
Size
Actions
API.php
27.83 KB
Del
OK
Adjacent_Events.php
9.13 KB
Del
OK
Admin
-
Del
OK
Admin_List.php
14.59 KB
Del
OK
Aggregator
-
Del
OK
Aggregator.php
16.7 KB
Del
OK
Ajax
-
Del
OK
Amalgamator.php
8.86 KB
Del
OK
Assets.php
19.96 KB
Del
OK
Backcompat.php
2.79 KB
Del
OK
Bar.php
3.28 KB
Del
OK
Capabilities.php
5.56 KB
Del
OK
Collections
-
Del
OK
Constants.php
1.64 KB
Del
OK
Cost_Utils.php
4.81 KB
Del
OK
Customizer
-
Del
OK
Dates
-
Del
OK
Deactivation.php
1.31 KB
Del
OK
Default_Values.php
793 B
Del
OK
Editor
-
Del
OK
Editor.php
16.92 KB
Del
OK
Embedded_Maps.php
5.37 KB
Del
OK
Event_Cleaner.php
2.59 KB
Del
OK
Event_Cleaner_Scheduler.php
5.95 KB
Del
OK
Event_Tickets
-
Del
OK
Featured_Events
-
Del
OK
Featured_Events.php
1.75 KB
Del
OK
Front_Page_View.php
9.87 KB
Del
OK
Google
-
Del
OK
Gutenberg.php
2.71 KB
Del
OK
I18n.php
10.51 KB
Del
OK
Ignored_Events.php
31.25 KB
Del
OK
Importer
-
Del
OK
Integrations
-
Del
OK
JSON_LD
-
Del
OK
Linked_Posts
-
Del
OK
Linked_Posts.php
43.79 KB
Del
OK
List_Widget.php
7.64 KB
Del
OK
Main.php
195.46 KB
Del
OK
Meta
-
Del
OK
Models
-
Del
OK
Options_Exception.php
890 B
Del
OK
Organizer.php
22.22 KB
Del
OK
Plugin_Register.php
675 B
Del
OK
Post_Exception.php
859 B
Del
OK
Privacy.php
1.31 KB
Del
OK
Query.php
54.4 KB
Del
OK
REST
-
Del
OK
Recurring_Event_Cleanup.php
2.13 KB
Del
OK
Repositories
-
Del
OK
Revisions
-
Del
OK
Rewrite.php
30.31 KB
Del
OK
Service_Providers
-
Del
OK
Shortcode
-
Del
OK
Template
-
Del
OK
Template_Factory.php
17.79 KB
Del
OK
Templates.php
24.04 KB
Del
OK
Timezones.php
6.37 KB
Del
OK
Updater.php
8.13 KB
Del
OK
Utils
-
Del
OK
Validator
-
Del
OK
Venue.php
22.95 KB
Del
OK
Views
-
Del
OK
iCal.php
26.37 KB
Del
OK
Edit: Recurring_Event_Cleanup.php
<?php /** * Converts recurring events to single instances * and back when pro plugin is activated or * deactivated */ class Tribe__Events__Recurring_Event_Cleanup { private $recurring = false; public function __construct() { $this->recurring = apply_filters( 'tribe_enable_recurring_event_queries', $this->recurring ); } /** * Modify the database appropriately to reflect the current * recurring events status */ public function toggle_recurring_events() { $current_status = tribe_get_option( 'recurring_events_are_hidden', false ); if ( $current_status == 'hidden' && $this->recurring ) { $this->restore_hidden_events(); tribe_update_option( 'recurring_events_are_hidden', 'exposed' ); } elseif ( $current_status == 'exposed' && ! $this->recurring ) { $this->hide_recurring_events(); tribe_update_option( 'recurring_events_are_hidden', 'hidden' ); } elseif ( ! $current_status ) { tribe_update_option( 'recurring_events_are_hidden', ( $this->recurring ? 'exposed' : 'hidden' ) ); } } /** * Convert hidden instances back to normal start dates */ private function restore_hidden_events() { global $wpdb; $wpdb->query( "UPDATE {$wpdb->postmeta} SET meta_key='_EventStartDate' WHERE meta_key='_HiddenEventStartDate'" ); } /** * Convert all but the first instance of a recurring event * to a hidden start date * * Reference for the subqueries: http://bugs.mysql.com/bug.php?id=21262 */ private function hide_recurring_events() { global $wpdb; $sql = "SELECT meta_id FROM {$wpdb->postmeta} WHERE meta_key='_EventStartDate' AND post_id IN ( SELECT post_id from ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_EventStartDate' GROUP BY post_id HAVING COUNT(meta_key) > 1 ) a ) AND meta_id NOT IN ( SELECT meta_id FROM ( SELECT meta_id FROM {$wpdb->postmeta} WHERE meta_key='_EventStartDate' GROUP BY post_id HAVING MIN(CAST(meta_value AS DATETIME)) ) b )"; $ids = $wpdb->get_col( $sql ); if ( $ids ) { $sql = sprintf( "UPDATE {$wpdb->postmeta} SET meta_key='_HiddenEventStartDate' WHERE meta_id IN (%s)", implode( ',', array_map( 'intval', $ids ) ) ); } $wpdb->query( $sql ); } }
Save