Created
March 19, 2012 18:26
-
-
Save PaulHughes01/2122918 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // From events-calendar-pro.php | |
| public function checkRequiredTecVersion( $array ) { | |
| $array['TribeEventsPro'] = array('plugin_name' => 'Events Calendar Pro', 'required_version' => TribeEventsPro::REQUIRED_TEC_VERSION); | |
| return $array; | |
| } | |
| // From the-events-calendar.class.php | |
| public function checkAddOnCompatibility() { | |
| $bad_versions = array(); | |
| $tec_addons_required_versions = array(); | |
| $tec_addons_required_versions = (array) apply_filters('tribe_tec_addons', $tec_addons_required_versions); | |
| foreach ($tec_addons_required_versions as $plugin) { | |
| if ( version_compare( $plugin['required_version'], self::VERSION, '>') ) { | |
| $bad_versions[$plugin['plugin_name']] = $plugin['required_version']; | |
| } | |
| } | |
| if ( count( $bad_versions ) > 0 ) { | |
| echo '<div class="error">'; | |
| foreach ($bad_versions as $plugin => $version) { | |
| echo '<p>'; | |
| printf( __('Your version of %s requires version %s or higher of The Events Calendar. Use at your own risk!', 'tribe-events-calendar'), $plugin, $version ); | |
| echo '</p>'; | |
| } | |
| echo '</div>'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment