PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 2.8.23.5
Pods – Custom Content Types and Fields v2.8.23.5
2.7.31.4 2.8.23.5 2.9.19.5 3.0.10.5 3.1.4.3 3.2.8.4 3.3.9.2 2.8.23.4 2.9.19.4 3.0.10.4 3.1.4.2 3.2.8.3 3.3.9.1 trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / tribe-common / src / Tribe / Plugins.php
pods / tribe-common / src / Tribe Last commit date
Admin 1 week ago Ajax 1 week ago Asset 1 week ago Context 1 week ago Customizer 1 week ago Debug_Bar 1 week ago Dialog 1 week ago Documentation 1 week ago Duplicate 1 week ago Editor 1 week ago Image 1 week ago JSON_LD 1 week ago Languages 1 week ago Log 1 week ago Meta 1 week ago Models 1 week ago PUE 1 week ago Process 1 week ago Promoter 1 week ago REST 1 week ago Repository 1 week ago Service_Providers 1 week ago Shortcode 1 week ago Support 1 week ago Tabbed_View 1 week ago Tooltip 1 week ago Traits 1 week ago Utils 1 week ago Validator 1 week ago Widget 1 week ago Abstract_Deactivation.php 1 week ago Abstract_Plugin_Register.php 1 week ago App_Shop.php 1 week ago Assets.php 1 week ago Assets_Pipeline.php 1 week ago Autoloader.php 1 week ago Cache.php 1 week ago Cache_Listener.php 1 week ago Changelog_Reader.php 1 week ago Container.php 1 week ago Context.php 1 week ago Cost_Utils.php 1 week ago Credits.php 1 week ago Customizer.php 1 week ago DB_Lock.php 1 week ago Data.php 1 week ago Date_Utils.php 1 week ago Db.php 1 week ago Debug.php 1 week ago Dependency.php 1 week ago Deprecation.php 1 week ago Editor.php 1 week ago Error.php 1 week ago Exception.php 1 week ago Extension.php 1 week ago Extension_Loader.php 1 week ago Feature_Detection.php 1 week ago Field.php 1 week ago Field_Conditional.php 1 week ago Freemius.php 1 week ago Log.php 1 week ago Main.php 1 week ago Notices.php 1 week ago Plugin_Meta_Links.php 1 week ago Plugins.php 1 week ago Plugins_API.php 1 week ago Post_History.php 1 week ago Post_Transient.php 1 week ago Promise.php 1 week ago Repository.php 1 week ago Rewrite.php 1 week ago Settings.php 1 week ago Settings_Manager.php 1 week ago Settings_Tab.php 1 week ago Simple_Table.php 1 week ago Support.php 1 week ago Tabbed_View.php 1 week ago Template.php 1 week ago Template_Factory.php 1 week ago Template_Part_Cache.php 1 week ago Templates.php 1 week ago Terms.php 1 week ago Timezones.php 1 week ago Tracker.php 1 week ago Updater.php 1 week ago Validate.php 1 week ago View_Helpers.php 1 week ago
Plugins.php
168 lines
1 <?php
2 // Don't load directly
3 defined( 'WPINC' ) or die;
4
5 if ( ! class_exists( 'Tribe__Plugins' ) ) {
6 /**
7 * A list of Tribe's major plugins. Useful when encouraging users to download one of these.
8 */
9 class Tribe__Plugins {
10
11 /**
12 * A list of tribe plugin's details in this array format:
13 *
14 * [
15 * 'short_name' => Common name for the plugin, used in places such as WP Admin messages
16 * 'class' => Main plugin class
17 * 'thickbox_url' => Download or purchase URL for plugin from within /wp-admin/ thickbox
18 * ]
19 */
20 private $tribe_plugins = [
21 [
22 'short_name' => 'Event Tickets',
23 'class' => 'Tribe__Tickets__Main',
24 'thickbox_url' => 'plugin-install.php?tab=plugin-information&plugin=event-tickets&TB_iframe=true',
25 ],
26 [
27 'short_name' => 'Event Tickets Plus',
28 'class' => 'Tribe__Tickets_Plus__Main',
29 'thickbox_url' => 'https://theeventscalendar.com/product/wordpress-event-tickets-plus/?TB_iframe=true',
30 ],
31 [
32 'short_name' => 'The Events Calendar',
33 'class' => 'Tribe__Events__Main',
34 'thickbox_url' => 'plugin-install.php?tab=plugin-information&plugin=the-events-calendar&TB_iframe=true',
35 ],
36 [
37 'short_name' => 'Events Calendar Pro',
38 'class' => 'Tribe__Events__Pro__Main',
39 'thickbox_url' => 'https://theeventscalendar.com/product/wordpress-events-calendar-pro/?TB_iframe=true',
40 ],
41 [
42 'short_name' => 'Community Events',
43 'class' => 'Tribe__Events__Community__Main',
44 'thickbox_url' => 'https://theeventscalendar.com/product/wordpress-community-events/?TB_iframe=true',
45 ],
46 [
47 'short_name' => 'Community Tickets',
48 'class' => 'Tribe__Events__Community__Tickets__Main',
49 'thickbox_url' => 'https://theeventscalendar.com/product/community-tickets/?TB_iframe=true',
50 ],
51 [
52 'short_name' => 'Filter Bar',
53 'class' => 'Tribe__Events__Filterbar__View',
54 'thickbox_url' => 'https://theeventscalendar.com/product/wordpress-events-filterbar/?TB_iframe=true',
55 ],
56 [
57 'short_name' => 'Facebook Events',
58 'class' => 'Tribe__Events__Facebook__Importer',
59 'thickbox_url' => 'https://theeventscalendar.com/product/facebook-events/?TB_iframe=true',
60 ],
61 [
62 'short_name' => 'iCal Importer',
63 'class' => 'Tribe__Events__Ical_Importer__Main',
64 'thickbox_url' => 'https://theeventscalendar.com/product/ical-importer/?TB_iframe=true',
65 ],
66 [
67 'short_name' => 'Eventbrite Tickets',
68 'class' => 'Tribe__Events__Tickets__Eventbrite__Main',
69 'thickbox_url' => 'https://theeventscalendar.com/product/wordpress-eventbrite-tickets/?TB_iframe=true',
70 ],
71 [
72 'short_name' => 'Advanced Post Manager',
73 'class' => 'Tribe_APM',
74 'thickbox_url' => 'plugin-install.php?tab=plugin-information&plugin=advanced-post-manager&TB_iframe=true',
75 ],
76 ];
77
78 /**
79 * Searches the plugin list for key/value pair and return the full details for that plugin
80 *
81 * @param string $search_key The array key this value will appear in
82 * @param string $search_val The value itself
83 *
84 * @return array|null
85 */
86 public function get_plugin_by_key( $search_key, $search_val ) {
87 foreach ( $this->get_list() as $plugin ) {
88 if ( isset( $plugin[ $search_key ] ) && $plugin[ $search_key ] === $search_val ) {
89 return $plugin;
90 }
91 }
92
93 return null;
94 }
95
96 /**
97 * Retrieves plugins details by plugin name
98 *
99 * @param string $name Common name for the plugin, not necessarily the lengthy name in the WP Admin Plugins list
100 *
101 * @return array|null
102 */
103 public function get_plugin_by_name( $name ) {
104 return $this->get_plugin_by_key( 'short_name', $name );
105 }
106
107 /**
108 * Retrieves plugins details by class name
109 *
110 * @param string $main_class Main/base class for this plugin
111 *
112 * @return array|null
113 */
114 public function get_plugin_by_class( $main_class ) {
115 return $this->get_plugin_by_key( 'class', $main_class );
116 }
117
118 /**
119 * Retrieves the entire list
120 *
121 * @return array
122 */
123 public function get_list() {
124 /**
125 * Gives an opportunity to filter the list of tribe plugins
126 *
127 * @since 4.7.18
128 *
129 * @param array Contains a list of all tribe plugins
130 */
131 return apply_filters( 'tribe_plugins_get_list', $this->tribe_plugins );
132 }
133
134 /**
135 * Checks if given plugin is active. Usually a The Events Calendar plugin.
136 *
137 * @param string $plugin_name The name of the plugin. Each plugin defines their name upon hooking on the filter.
138 *
139 * @since 4.12.1
140 *
141 * @return bool True if plugin is active. False if plugin is not active.
142 */
143 public static function is_active( $plugin_name ) {
144 if ( ! did_action( "plugins_loaded" ) ) {
145 _doing_it_wrong(
146 __METHOD__,
147 __( 'Using this function before "plugins_loaded" action has fired can return unreliable results.', 'tribe-common' ),
148 '4.12.6'
149 );
150 }
151
152 /**
153 * Filters the array that each Tribe plugin overrides to
154 * set itself as active when this function is called.
155 *
156 * @example [ 'the-events-calendar' => true, 'event-tickets' => true ]
157 *
158 * @since 4.12.1
159 *
160 * @return array Plugin slugs as keys and bool as value for whether it's active or not.
161 */
162 $plugins = apply_filters( 'tribe_active_plugins', [] );
163
164 return isset( $plugins[ $plugin_name ] ) && tribe_is_truthy( $plugins[ $plugin_name ] );
165 }
166 }
167 }
168