Add support for non-standard Theme Directories
-
Currently the theme directory path is hardcoded as
substr($_SERVER['SCRIPT_FILENAME'],0,-19).'wp-content/themes
on line 41 of main.php this should be updated for non-standard WordPress content directories.One solution is to replace
$root = substr($_SERVER['SCRIPT_FILENAME'],0,-19).'wp-content/themes';
with
$root = get_theme_root();
You will also want to replace the root on line 83:
$template_root = substr($_SERVER['SCRIPT_FILENAME'],0,-19).'wp-content/themes/'.$template.'/';
with:
$template_root = get_theme_root() . '/' .$template.'/';
and on line 91
$make = $export->add($add, PCLZIP_OPT_REMOVE_PATH, substr($_SERVER['SCRIPT_FILENAME'],0,-19).'wp-content
with
$make = $export->add($add, PCLZIP_OPT_REMOVE_PATH, get_theme_root() );
I would also recommend using the built-in version of class pclzip found in
wp-admin/includes/class-pclzip.php
Replace
require_once WPCT_PATH.'lib/pclzip.lib.php';
withrequire_once '/includes/class-pclzip.php';
on 74. This will allow you to remove the included library.There is also a typo on line 80
permissons
instead ofpermissions
Hope this helps!
- The topic ‘Add support for non-standard Theme Directories’ is closed to new replies.