/**
  * Singleton constructor for the class.
  *
  * @return Tribe__Events__Pro__Recurrence__Scripts
  */
 public static function instance()
 {
     if (empty(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #2
0
 public static function init()
 {
     add_action('tribe_events_update_meta', array(__CLASS__, 'updateRecurrenceMeta'), 20, 2);
     // give other meta a chance to save, first
     add_action('tribe_events_date_display', array(__CLASS__, 'loadRecurrenceData'));
     add_action('wp_trash_post', array(__CLASS__, 'handle_trash_request'));
     add_action('before_delete_post', array(__CLASS__, 'handle_delete_request'));
     add_action('untrashed_post', array(__CLASS__, 'handle_untrash_request'));
     add_filter('get_edit_post_link', array(__CLASS__, 'filter_edit_post_link'), 10, 3);
     add_filter('preprocess_comment', array(__CLASS__, 'set_parent_for_recurring_event_comments'), 10, 1);
     add_action('pre_get_comments', array(__CLASS__, 'set_post_id_for_recurring_event_comment_queries'), 10, 1);
     add_action('comment_post_redirect', array(__CLASS__, 'fix_redirect_after_comment_is_posted'), 10, 2);
     add_action('wp_update_comment_count', array(__CLASS__, 'update_comment_counts_on_child_events'), 10, 3);
     add_filter('comments_array', array(__CLASS__, 'set_comments_array_on_child_events'), 10, 2);
     add_action('admin_notices', array(__CLASS__, 'showRecurrenceErrorFlash'));
     add_action('tribe_recurring_event_error', array(__CLASS__, 'setupRecurrenceErrorMsg'), 10, 2);
     add_filter('manage_' . Tribe__Events__Main::POSTTYPE . '_posts_columns', array(__CLASS__, 'list_table_column_headers'));
     add_action('manage_' . Tribe__Events__Main::POSTTYPE . '_posts_custom_column', array(__CLASS__, 'populate_custom_list_table_columns'), 10, 2);
     add_filter('post_class', array(__CLASS__, 'add_recurring_event_post_classes'), 10, 3);
     add_filter('post_row_actions', array(__CLASS__, 'edit_post_row_actions'), 10, 2);
     add_action('admin_action_tribe_split', array(__CLASS__, 'handle_split_request'), 10, 1);
     add_action('wp_before_admin_bar_render', array(__CLASS__, 'admin_bar_render'));
     add_filter('posts_request', array('Tribe__Events__Pro__Recurrence__Queries', 'collapse_sql'), 10, 2);
     add_filter('tribe_settings_tab_fields', array(__CLASS__, 'inject_settings'), 10, 2);
     add_action('load-edit.php', array(__CLASS__, 'combineRecurringRequestIds'));
     add_action('updated_post_meta', array(__CLASS__, 'update_child_thumbnails'), 4, 40);
     add_action('added_post_meta', array(__CLASS__, 'update_child_thumbnails'), 4, 40);
     add_action('deleted_post_meta', array(__CLASS__, 'remove_child_thumbnails'), 4, 40);
     add_action('tribe_community_events_enqueue_resources', array(__CLASS__, 'enqueue_recurrence_data'));
     add_action('tribe_events_community_form_before_template', array(__CLASS__, 'output_recurrence_json_data'));
     add_action('update_option_' . Tribe__Main::OPTIONNAME, array(Tribe__Events__Pro__Recurrence__Old_Events_Cleaner::instance(), 'clean_up_old_recurring_events'), 10, 2);
     add_filter('tribe_events_pro_output_recurrence_data', array(__CLASS__, 'maybe_fix_datepicker_output'), 10, 2);
     if (is_admin()) {
         add_filter('tribe_events_pro_localize_script', array(Tribe__Events__Pro__Recurrence__Scripts::instance(), 'localize'), 10, 3);
     }
     self::reset_scheduler();
     /**
      * Register Notices
      */
     Tribe__Admin__Notices::instance()->register('editing-all-recurrences', array(__CLASS__, 'render_notice_editing_all_recurrences'), 'type=success');
     Tribe__Admin__Notices::instance()->register('created-recurrences', array(__CLASS__, 'render_notice_created_recurrences'), 'type=success');
 }