Permalink
Browse files

load if compat with php 5.2

  • Loading branch information...
1 parent 65004ae commit 4bf8e660cad1353acabd82aa591c4af9883342a0 @matzko committed Mar 16, 2011
Showing with 28 additions and 2 deletions.
  1. 0 includes/l10n/index.html
  2. +28 −2 loader.php
View
No changes.
View
@@ -11,8 +11,34 @@
*/
-class WP_Lite_Autosuggest_Control
-{
+if ( version_compare( PHP_VERSION, '5.2.0') >= 0 ) {
+
+ require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'wp-lite-autosuggest.php';
+
+} else {
+
+ function wp_lite_autosuggest_php_version_message()
+ {
+ ?>
+ <div id="wp-lite-autosuggest-warning" class="updated fade error">
+ <p>
+ <?php
+ printf(
+ __('<strong>ERROR</strong>: Your WordPress site is using an outdated version of PHP, %s. Version 5.2 of PHP is required to use the WP Lite Autosuggest plugin. Please ask your host to update.', 'wp-lite-autosuggest'),
+ PHP_VERSION
+ );
+ ?>
+ </p>
+ </div>
+ <?php
+ }
+ add_action('admin_notices', 'wp_lite_autosuggest_php_version_message');
+}
+
+function wp_lite_autosuggest_init_event()
+{
+ load_plugin_textdomain('wp-lite-autosuggest', null, dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'l10n');
}
+add_action('init', 'wp_lite_autosuggest_init_event');

0 comments on commit 4bf8e66

Please sign in to comment.