Admin
8 years ago
Ajax
8 years ago
Asset
8 years ago
Customizer
8 years ago
Documentation
8 years ago
Duplicate
8 years ago
Image
8 years ago
JSON_LD
8 years ago
Languages
8 years ago
Log
8 years ago
Meta
8 years ago
PUE
8 years ago
Process
8 years ago
REST
8 years ago
Service_Providers
8 years ago
Support
8 years ago
Tabbed_View
8 years ago
Utils
8 years ago
Validator
8 years ago
Abstract_Deactivation.php
8 years ago
App_Shop.php
8 years ago
Assets.php
8 years ago
Assets_Pipeline.php
8 years ago
Autoloader.php
8 years ago
Cache.php
8 years ago
Cache_Listener.php
8 years ago
Changelog_Reader.php
8 years ago
Container.php
8 years ago
Context.php
8 years ago
Cost_Utils.php
8 years ago
Credits.php
8 years ago
Customizer.php
8 years ago
Data.php
8 years ago
Date_Utils.php
8 years ago
Debug.php
8 years ago
Dependency.php
8 years ago
Deprecation.php
8 years ago
Error.php
8 years ago
Exception.php
8 years ago
Extension.php
8 years ago
Extension_Loader.php
8 years ago
Field.php
8 years ago
Field_Conditional.php
8 years ago
Log.php
8 years ago
Main.php
8 years ago
Notices.php
8 years ago
Plugin_Meta_Links.php
8 years ago
Plugins.php
8 years ago
Plugins_API.php
8 years ago
Post_History.php
8 years ago
Post_Transient.php
8 years ago
Rewrite.php
8 years ago
Settings.php
8 years ago
Settings_Manager.php
8 years ago
Settings_Tab.php
8 years ago
Simple_Table.php
8 years ago
Support.php
8 years ago
Tabbed_View.php
8 years ago
Template.php
8 years ago
Template_Factory.php
8 years ago
Template_Part_Cache.php
8 years ago
Templates.php
8 years ago
Terms.php
8 years ago
Timezones.php
8 years ago
Tracker.php
8 years ago
Validate.php
8 years ago
View_Helpers.php
8 years ago
Plugins.php
129 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 format: |
| 13 | * |
| 14 | * array( |
| 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 = array( |
| 21 | array( |
| 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 | array( |
| 27 | 'short_name' => 'Event Tickets Plus', |
| 28 | 'class' => 'Tribe__Tickets_Plus__Main', |
| 29 | 'thickbox_url' => '//theeventscalendar.com/product/wordpress-event-tickets-plus/?TB_iframe=true', |
| 30 | ), |
| 31 | array( |
| 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 | array( |
| 37 | 'short_name' => 'Events Calendar Pro', |
| 38 | 'class' => 'Tribe__Events__Pro__Main', |
| 39 | 'thickbox_url' => '//theeventscalendar.com/product/wordpress-events-calendar-pro/?TB_iframe=true', |
| 40 | ), |
| 41 | array( |
| 42 | 'short_name' => 'Community Events', |
| 43 | 'class' => 'Tribe__Events__Community__Main', |
| 44 | 'thickbox_url' => '//theeventscalendar.com/product/wordpress-community-events/?TB_iframe=true', |
| 45 | ), |
| 46 | array( |
| 47 | 'short_name' => 'Community Tickets', |
| 48 | 'class' => 'Tribe__Events__Community__Tickets__Main', |
| 49 | 'thickbox_url' => '//theeventscalendar.com/product/community-tickets/?TB_iframe=true', |
| 50 | ), |
| 51 | array( |
| 52 | 'short_name' => 'Filter Bar', |
| 53 | 'class' => 'Tribe__Events__Filterbar__View', |
| 54 | 'thickbox_url' => '//theeventscalendar.com/product/wordpress-events-filterbar/?TB_iframe=true', |
| 55 | ), |
| 56 | array( |
| 57 | 'short_name' => 'Facebook Events', |
| 58 | 'class' => 'Tribe__Events__Facebook__Importer', |
| 59 | 'thickbox_url' => '//theeventscalendar.com/product/facebook-events/?TB_iframe=true', |
| 60 | ), |
| 61 | array( |
| 62 | 'short_name' => 'iCal Importer', |
| 63 | 'class' => 'Tribe__Events__Ical_Importer__Main', |
| 64 | 'thickbox_url' => '//theeventscalendar.com/product/ical-importer/?TB_iframe=true', |
| 65 | ), |
| 66 | array( |
| 67 | 'short_name' => 'Eventbrite Tickets', |
| 68 | 'class' => 'Tribe__Events__Tickets__Eventbrite__Main', |
| 69 | 'thickbox_url' => '//theeventscalendar.com/product/wordpress-eventbrite-tickets/?TB_iframe=true', |
| 70 | ), |
| 71 | array( |
| 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->tribe_plugins 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 | return $this->tribe_plugins; |
| 125 | } |
| 126 | |
| 127 | } |
| 128 | } |
| 129 |