diff --git a/plugins/cipf_plugin/utils/plgntls_class.php b/plugins/cipf_plugin/utils/plgntls_class.php index 4c3512e..e69df84 100644 --- a/plugins/cipf_plugin/utils/plgntls_class.php +++ b/plugins/cipf_plugin/utils/plgntls_class.php @@ -152,10 +152,21 @@ class PLGNTLS_class private static function set_root_dir() { if (isset(self::$_plugin_name, self::$_file_name, self::$_file_dir_path, self::$_plugin_dir_path)) return ; + /* + * it uses exploded_path_path by removing data from the array + * so order is important ! + * plugin_name / path / to / file.php + * exploded [plugin_name, path, to, file.php] + * plugin_name plugin_name [path, to, file.php] + * file_name [path, to] file.php + * file_dir_name path / to + */ $exploded_plugin_path = explode('/', plugin_basename( __FILE__ )); + self::$_plugin_name = array_shift($exploded_plugin_path); self::$_file_name = array_pop($exploded_plugin_path); self::$_file_dir_path = implode('/', $exploded_plugin_path); + self::$_plugin_dir_path = str_replace('/'.plugin_basename(__DIR__).'/', '', plugin_dir_path(__FILE__)); self::$_root_path = self::$_plugin_dir_path.'/'.self::$_plugin_name.'/'; self::$_root_url = plugins_url(self::$_plugin_name.'/');