Tagged: checker, piklist checker, piklister checker
- This topic has 2 replies, 2 voices, and was last updated 6 years, 11 months ago by
Steve.
-
AuthorPosts
-
-
February 27, 2015 at 4:40 am #3368
MarcusMemberI’ve been trying for the life of me to implement piklist checker in my plugin, but seem to get the same response everytime I activate the plugin without piklist being downloaded. ‘Plugin Activated’
Maybe someone can help me with where its going wrong, as no matter what I try within these classes, nothing will show the ‘download piklist now’ box.
Here’s the code:if(!class_exists('WP_piklist_fields')) { class WP_piklist_fields { /** * Construct the plugin object */ public function __construct() { add_action( 'init', array('WP_piklist_fields', 'init_plugin')); } // END public function load /** * Init the plugin */ public static function init_plugin() { if(is_admin()) { include_once('piklist-checker/class-piklist-checker.php'); if (!piklist_checker::check(__FILE__)) { return; } } } // END public static function init_plugin /** * Activate the plugin */ public static function activate() { // Do nothing } // END public static function activate /** * Deactivate the plugin */ public static function deactivate() { // Do nothing } // END public static function deactivate } // END class WP_piklist_fields } // END if(!class_exists('WP_piklist_fields')) if(class_exists('WP_piklist_fields')) { // Installation and uninstallation hooks register_activation_hook(__FILE__, array('WP_piklist_fields', 'activate')); register_deactivation_hook(__FILE__, array('WP_piklist_fields', 'deactivate')); // instantiate the plugin class $WP_piklist_fields = new WP_piklist_fields(); }Pre-thanks to anyone that can fix this…
Marcus
-
February 27, 2015 at 6:25 am #3369
MarcusMemberFound it, solved it.
It’s a BUG with windows and localhost installs.
The __FILE__ var, doesn’t match the paths that wordpress generates when getting the list of plugins, so I changed the following in the piklist checker code from:if(is_admin()) { include_once('piklist-checker/class-piklist-checker.php'); if (!piklist_checker::check(__FILE__)) { return; } }To:
if(is_admin()) { include_once('piklist-checker/class-piklist-checker.php'); $local=(strstr(__FILE__,'\\'))?str_replace('\\', '/',__FILE__):__FILE__; if (!piklist_checker::check($local)) { return; } }Bam!:
Fixed -
March 4, 2015 at 10:57 am #3381
SteveKeymaster@marcus– Thank you for moving this fix into Piklist Checker. The latest version, which now support Windows, is on WordPress.org >
-
-
AuthorPosts
- The topic ‘Piklist Checker Woes.’ is closed to new replies.