From 05d66be91d6dbe65676079c303c8942b798f8d40 Mon Sep 17 00:00:00 2001 From: Coen Jacobs Date: Mon, 24 Nov 2014 14:17:54 +0100 Subject: [PATCH] Accept argument to provide custom plugin path For use cases where the plugins live outside the WP_PLUGIN_DIR --- updater.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/updater.php b/updater.php index e0aca92..f7e9b11 100644 --- a/updater.php +++ b/updater.php @@ -338,11 +338,24 @@ public function get_description() { */ public function get_plugin_data() { include_once ABSPATH.'/wp-admin/includes/plugin.php'; - $data = get_plugin_data( WP_PLUGIN_DIR.'/'.$this->config['slug'] ); + $data = get_plugin_data($this->get_plugin_path()); return $data; } + /** + * @since 1.6 + * @return string containing path to this plugin + */ + public function get_plugin_path() { + if ( isset($this->config['plugin_path'] ) ) { + return $this->config['plugin_path']; + } + + return WP_PLUGIN_DIR.'/'.$this->config['slug']; + } + + /** * Hook into the plugin update check and connect to GitHub *