public function filter_settings_tab_fields($fields, $tab) { switch ($tab) { case 'display': $fields = TribeEvents::array_insert_after_key('tribeDisableTribeBar', $fields, array('hideRelatedEvents' => array('type' => 'checkbox_bool', 'label' => __('Hide related events', 'tribe-events-calendar-pro'), 'tooltip' => __('Remove related events from the single event view', 'tribe-events-calendar-pro'), 'default' => false, 'validation_type' => 'boolean'))); break; } return $fields; }
/** * Inject the GeoLoc settings into the general TEC settings screen * * @param $args * @param $id * * @return array */ public function inject_settings($args, $id) { if ($id == 'general') { $venues = $this->get_venues_without_geoloc_info(); // we want to inject the map default distance and unit into the map section directly after "enable Google Maps" $args = TribeEvents::array_insert_after_key('embedGoogleMaps', $args, array('geoloc_default_geofence' => array('type' => 'text', 'label' => __('Map view search distance limit', 'tribe-events-calendar-pro'), 'size' => 'small', 'tooltip' => __('Set the distance that the location search covers (find events within X distance units of location search input).', 'tribe-events-calendar-pro'), 'default' => '25', 'class' => '', 'validation_type' => 'number_or_percent'), 'geoloc_default_unit' => array('type' => 'dropdown', 'label' => __('Map view distance unit', 'tribe-events-calendar-pro'), 'validation_type' => 'options', 'size' => 'small', 'default' => 'miles', 'options' => apply_filters('tribe_distance_units', array('miles' => __('Miles', 'tribe-events-calendar-pro'), 'kms' => __('Kilometers', 'tribe-events-calendar-pro')))), 'geoloc_fix_venues' => array('type' => 'html', 'html' => '<a name="geoloc_fix"></a><fieldset class="tribe-field tribe-field-html"><legend>' . __('Fix geolocation data', 'tribe-events-calendar-pro') . '</legend><div class="tribe-field-wrap">' . $this->fix_geoloc_data_button() . '<p class="tribe-field-indent description">' . sprintf(__("You have %d venues for which we don't have geolocation data. We need to use the Google Maps API to get that information. Doing this may take a while (aprox. 1 minute for every 200 venues).", 'tribe-events-calendar-pro'), $venues->found_posts) . '</p></div></fieldset>', 'conditional' => $venues->found_posts > 0))); } elseif ($id == 'display') { $args = TribeEvents::array_insert_after_key('tribeDisableTribeBar', $args, array('hideLocationSearch' => array('type' => 'checkbox_bool', 'label' => __('Hide location search', 'tribe-events-calendar-pro'), 'tooltip' => __('Removes location search field from the events bar on all views except for map view.', 'tribe-events-calendar-pro'), 'default' => false, 'validation_type' => 'boolean'))); } return $args; }
public function filter_settings_tab_fields($fields, $tab) { switch ($tab) { case 'display': $fields = TribeEvents::array_insert_after_key('tribeDisableTribeBar', $fields, array('hideRelatedEvents' => array('type' => 'checkbox_bool', 'label' => __('Hide related events', 'tribe-events-calendar-pro'), 'tooltip' => __('Remove related events from the single event view', 'tribe-events-calendar-pro'), 'default' => false, 'validation_type' => 'boolean'))); $fields = TribeEvents::array_insert_after_key('monthAndYearFormat', $fields, array('weekDayFormat' => array('type' => 'text', 'label' => __('Week Day Format', 'tribe-events-calendar-pro'), 'tooltip' => __('Enter the format to use for week days. Used when showing an days of the week in Week view.', 'tribe-events-calendar-pro'), 'default' => 'D jS', 'size' => 'medium', 'validation_type' => 'html'))); break; } return $fields; }
/** * Adds setting for hiding subsequent occurrences by default. * * * @param array $args * @param string $id * * @return array */ public static function inject_settings($args, $id) { if ($id == 'general') { // we want to inject the hiding subsequent occurrences into the general section directly after "Live update AJAX" $args = TribeEvents::array_insert_after_key('liveFiltersUpdate', $args, array('hideSubsequentRecurrencesDefault' => array('type' => 'checkbox_bool', 'label' => __('Recurring event instances', 'tribe-events-calendar-pro'), 'tooltip' => __('Show only the first instance of each recurring event (only affects list-style views).', 'tribe-events-calendar-pro'), 'default' => false, 'validation_type' => 'boolean'), 'userToggleSubsequentRecurrences' => array('type' => 'checkbox_bool', 'label' => __('Front-end recurring event instances toggle', 'tribe-events-calendar-pro'), 'tooltip' => __('Allow users to decide whether to show all instances of a recurring event.', 'tribe-events-calendar-pro'), 'default' => false, 'validation_type' => 'boolean'), 'recurrenceMaxMonthsBefore' => array('type' => 'text', 'size' => 'small', 'label' => __('Clean up recurring events after', 'tribe-events-calendar-pro'), 'tooltip' => __('Automatically remove recurring event instances older than this', 'tribe-events-calendar-pro'), 'validation_type' => 'positive_int', 'default' => 24), 'recurrenceMaxMonthsAfter' => array('type' => 'text', 'size' => 'small', 'label' => __('Create recurring events in advance for', 'tribe-events-calendar-pro'), 'tooltip' => __('Recurring events will be created this far in advance', 'tribe-events-calendar-pro'), 'validation_type' => 'positive_int', 'default' => 24))); add_filter('tribe_field_div_end', array(__CLASS__, 'add_months_to_settings_field'), 100, 2); } return $args; }