golden hour
/var/www/html/wp-content/plugins/the-events-calendar/common/src/Tribe
⬆️ Go Up
Upload
File/Folder
Size
Actions
Abstract_Deactivation.php
1.65 KB
Del
OK
Abstract_Plugin_Register.php
1.25 KB
Del
OK
Admin
-
Del
OK
Ajax
-
Del
OK
App_Shop.php
9.87 KB
Del
OK
Asset
-
Del
OK
Assets.php
24.69 KB
Del
OK
Assets_Pipeline.php
1.7 KB
Del
OK
Autoloader.php
8.31 KB
Del
OK
Cache.php
18.13 KB
Del
OK
Cache_Listener.php
5.92 KB
Del
OK
Changelog_Reader.php
1.5 KB
Del
OK
Container.php
11.36 KB
Del
OK
Context
-
Del
OK
Context.php
48.65 KB
Del
OK
Cost_Utils.php
16.44 KB
Del
OK
Credits.php
2.9 KB
Del
OK
Customizer
-
Del
OK
Customizer.php
25.29 KB
Del
OK
DB_Lock.php
10.04 KB
Del
OK
Data.php
5.21 KB
Del
OK
Date_Utils.php
48.59 KB
Del
OK
Db.php
876 B
Del
OK
Debug.php
1.54 KB
Del
OK
Debug_Bar
-
Del
OK
Dependency.php
16.47 KB
Del
OK
Deprecation.php
4.84 KB
Del
OK
Dialog
-
Del
OK
Documentation
-
Del
OK
Duplicate
-
Del
OK
Editor
-
Del
OK
Editor.php
6.58 KB
Del
OK
Error.php
4.51 KB
Del
OK
Exception.php
2.08 KB
Del
OK
Extension.php
13 KB
Del
OK
Extension_Loader.php
3.96 KB
Del
OK
Feature_Detection.php
7.51 KB
Del
OK
Field.php
22.38 KB
Del
OK
Field_Conditional.php
2.37 KB
Del
OK
Freemius.php
1.34 KB
Del
OK
Image
-
Del
OK
JSON_LD
-
Del
OK
Languages
-
Del
OK
Log
-
Del
OK
Log.php
11.33 KB
Del
OK
Main.php
23.13 KB
Del
OK
Meta
-
Del
OK
Models
-
Del
OK
Notices.php
1.49 KB
Del
OK
PUE
-
Del
OK
Plugin_Meta_Links.php
3.45 KB
Del
OK
Plugins.php
5.32 KB
Del
OK
Plugins_API.php
12.2 KB
Del
OK
Post_History.php
2.96 KB
Del
OK
Post_Transient.php
5.76 KB
Del
OK
Process
-
Del
OK
Promise.php
9.04 KB
Del
OK
Promoter
-
Del
OK
REST
-
Del
OK
Repository
-
Del
OK
Repository.php
100.06 KB
Del
OK
Rewrite.php
34.63 KB
Del
OK
Service_Providers
-
Del
OK
Settings.php
23.81 KB
Del
OK
Settings_Manager.php
9.78 KB
Del
OK
Settings_Tab.php
6.93 KB
Del
OK
Shortcode
-
Del
OK
Simple_Table.php
4.01 KB
Del
OK
Support
-
Del
OK
Support.php
14.43 KB
Del
OK
Tabbed_View
-
Del
OK
Tabbed_View.php
8.1 KB
Del
OK
Template.php
43.65 KB
Del
OK
Template_Factory.php
5.45 KB
Del
OK
Template_Part_Cache.php
2.74 KB
Del
OK
Templates.php
1.79 KB
Del
OK
Terms.php
1.51 KB
Del
OK
Timezones.php
18.21 KB
Del
OK
Tooltip
-
Del
OK
Tracker.php
12.51 KB
Del
OK
Traits
-
Del
OK
Updater.php
3.78 KB
Del
OK
Utils
-
Del
OK
Validate.php
16.54 KB
Del
OK
Validator
-
Del
OK
View_Helpers.php
9.64 KB
Del
OK
Widget
-
Del
OK
Edit: Settings_Tab.php
<?php // Don't load directly if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } if ( ! class_exists( 'Tribe__Settings_Tab' ) ) { /** * helper class that creates a settings tab * this is a public API, use it to create tabs * simply by instantiating this class * */ class Tribe__Settings_Tab { /** * Tab ID, used in query string and elsewhere * @var string */ public $id; /** * Tab's name * @var string */ public $name; /** * Tab's arguments * @var array */ public $args; /** * Defaults for tabs * @var array */ public $defaults; /** * class constructor * * @param string $id the tab's id (no spaces or special characters) * @param string $name the tab's visible name * @param array $args additional arguments for the tab */ public function __construct( $id, $name, $args = [] ) { // setup the defaults $this->defaults = [ 'fields' => [], 'priority' => 50, 'show_save' => true, 'display_callback' => false, 'network_admin' => false, ]; // parse args with defaults $this->args = wp_parse_args( $args, $this->defaults ); // set each instance variable and filter $this->id = apply_filters( 'tribe_settings_tab_id', $id ); $this->name = apply_filters( 'tribe_settings_tab_name', $name ); foreach ( $this->defaults as $key => $value ) { $this->{$key} = apply_filters( 'tribe_settings_tab_' . $key, $this->args[ $key ], $id ); } // run actions & filters if ( ! $this->network_admin ) { add_filter( 'tribe_settings_all_tabs', [ $this, 'addAllTabs' ] ); } add_filter( 'tribe_settings_tabs', [ $this, 'addTab' ], $this->priority ); } /** * filters the tabs array from Tribe__Settings * and adds the current tab to it * does not add a tab if it's empty * * @param array $tabs the $tabs from Tribe__Settings * * @return array $tabs the filtered tabs */ public function addTab( $tabs ) { $hideSettingsTabs = Tribe__Settings_Manager::get_network_option( 'hideSettingsTabs', [] ); if ( ( isset( $this->fields ) || has_action( 'tribe_settings_content_tab_' . $this->id ) ) && ( empty( $hideSettingsTabs ) || ! in_array( $this->id, $hideSettingsTabs ) ) ) { if ( ( is_network_admin() && $this->args['network_admin'] ) || ( ! is_network_admin() && ! $this->args['network_admin'] ) ) { $tabs[ $this->id ] = $this->name; add_filter( 'tribe_settings_fields', [ $this, 'addFields' ] ); add_filter( 'tribe_settings_no_save_tabs', [ $this, 'showSaveTab' ] ); add_filter( 'tribe_settings_content_tab_' . $this->id, [ $this, 'doContent' ] ); } } return $tabs; } /** * Adds this tab to the list of total tabs, even if it is not displayed. * * @param array $allTabs All the tabs from Tribe__Settings. * * @return array $allTabs All the tabs. */ public function addAllTabs( $allTabs ) { $allTabs[ $this->id ] = $this->name; return $allTabs; } /** * filters the fields array from Tribe__Settings * and adds the current tab's fields to it * * @param array $field the $fields from Tribe__Settings * * @return array $fields the filtered fields */ public function addFields( $fields ) { if ( ! empty ( $this->fields ) ) { $fields[ $this->id ] = $this->fields; } elseif ( has_action( 'tribe_settings_content_tab_' . $this->id ) ) { $fields[ $this->id ] = $this->fields = [ 0 => null ]; // just to trick it } return $fields; } /** * sets whether the current tab should show the save * button or not * * @param array $noSaveTabs the $noSaveTabs from Tribe__Settings * * @return array $noSaveTabs the filtered non saving tabs */ public function showSaveTab( $noSaveTabs ) { if ( ! $this->show_save || empty( $this->fields ) ) { $noSaveTabs[ $this->id ] = $this->id; } return $noSaveTabs; } /** * displays the content for the tab * * @return void */ public function doContent() { if ( $this->display_callback && is_callable( $this->display_callback ) ) { call_user_func( $this->display_callback ); return; } $sent_data = get_option( 'tribe_settings_sent_data', [] ); if ( is_array( $this->fields ) && ! empty( $this->fields ) ) { foreach ( $this->fields as $key => $field ) { if ( isset( $sent_data[ $key ] ) ) { // If we just saved [or attempted to], get the value that was input. $value = $sent_data[ $key ]; } else { // Some options should always be stored at network level $network_option = isset( $field['network_option'] ) ? (bool) $field['network_option'] : false; if ( is_network_admin() ) { $parent_option = ( isset( $field['parent_option'] ) ) ? $field['parent_option'] : Tribe__Main::OPTIONNAMENETWORK; } if ( ! is_network_admin() ) { $parent_option = ( isset( $field['parent_option'] ) ) ? $field['parent_option'] : Tribe__Main::OPTIONNAME; } // get the field's parent_option in order to later get the field's value $parent_option = apply_filters( 'tribe_settings_do_content_parent_option', $parent_option, $key ); $default = ( isset( $field['default'] ) ) ? $field['default'] : null; $default = apply_filters( 'tribe_settings_field_default', $default, $field ); if ( ! $parent_option ) { // no parent option, get the straight up value if ( $network_option || is_network_admin() ) { $value = get_site_option( $key, $default ); } else { $value = get_option( $key, $default ); } } else { // there's a parent option if ( $parent_option == Tribe__Main::OPTIONNAME ) { // get the options from Tribe__Settings_Manager if we're getting the main array $value = Tribe__Settings_Manager::get_option( $key, $default ); } elseif ( $parent_option == Tribe__Main::OPTIONNAMENETWORK ) { $value = Tribe__Settings_Manager::get_network_option( $key, $default ); } else { // else, get the parent option normally if ( is_network_admin() ) { $options = (array) get_site_option( $parent_option ); } else { $options = (array) get_option( $parent_option ); } $value = ( isset( $options[ $key ] ) ) ? $options[ $key ] : $default; } } } // escape the value for display if ( ! empty( $field['esc_display'] ) && function_exists( $field['esc_display'] ) ) { $value = $field['esc_display']( $value ); } elseif ( is_string( $value ) ) { $value = esc_attr( stripslashes( $value ) ); } // filter the value $value = apply_filters( 'tribe_settings_get_option_value_pre_display', $value, $key, $field ); // create the field new Tribe__Field( $key, $field, $value ); } } else { // no fields setup for this tab yet echo '<p>' . esc_html__( 'There are no fields setup for this tab yet.', 'tribe-common' ) . '</p>'; } } } // end class } // endif class_exists
Save