Plugin Directory

Changeset 3253331


Ignore:
Timestamp:
03/10/2025 01:08:50 PM (13 months ago)
Author:
lwsdevelopers
Message:

Fix - language loading path

Location:
woorewards/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • woorewards/trunk/assets/lws-adminpanel/include/admin.php

    r3227529 r3253331  
    3737
    3838        \add_action('after_setup_theme', function() {
    39             \load_plugin_textdomain('lws-adminpanel', FALSE, \basename(dirname(LWS_ADMIN_PANEL_FILE)) . '/languages/');
     39            \load_plugin_textdomain('lws-adminpanel', FALSE, \LWS\Adminpanel\Tools\Conveniences::getPluginSubpath(LWS_ADMIN_PANEL_FILE, '/languages/'));
    4040        });
    4141
  • woorewards/trunk/assets/lws-adminpanel/include/tools/conveniences.php

    r3253191 r3253331  
    497497        $bal = $default;
    498498        if( isset($descr['tag']) ){
    499             $bal = \is_array($descr['tag']) ? $self::array2tag($descr['tag']) : $descr['tag'];
     499            $bal = \is_array($descr['tag']) ? self::array2tag($descr['tag']) : $descr['tag'];
    500500            unset($descr['tag']);
    501501        }
     
    687687        }
    688688    }
     689
     690    /**
     691     * @param $file string a file in the root directory of the plugin as reference.
     692     * @param $clue string a directory name that should exists in full path if plugin is embeded into someone else.
     693     * @param $path string appended to the returned path.
     694     * @return string the path from wp plugin dir to the base directory of the plugin (including plugin directory).
     695     */
     696    public static function getPluginSubpath(string $file, string $path=''): string
     697    {
     698        $dir = \basename(dirname($file));
     699        $sub = \substr($file, \strlen(WP_PLUGIN_DIR));
     700        $pos = \strpos($sub, $dir);
     701        if (false !== $pos) {
     702            $dir = \substr($sub, 0, $pos + \strlen($dir));
     703        }
     704        return \rtrim($dir, '/\\') . '/' . \ltrim($path, '/\\');
     705    }
    689706}
  • woorewards/trunk/assets/lws-adminpanel/lws-adminpanel.php

    r3253191 r3253331  
    66 * Author: Long Watch Studio
    77 * Author URI: https://longwatchstudio.com
    8  * Version: 5.5.18
     8 * Version: 5.5.19
    99 * Text Domain: lws-adminpanel
    1010 *
     
    5858
    5959add_filter('lws_adminpanel_versions', function($versions){
    60     $versions['5.5.18'] = __FILE__;
     60    $versions['5.5.19'] = __FILE__;
    6161    return $versions;
    6262});
  • woorewards/trunk/readme.txt

    r3253191 r3253331  
    55Tested up to: 6.7
    66Requires PHP: 7.0.0
    7 Stable tag: 5.4.9
     7Stable tag: 5.4.10
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    110110== Changelog ==
    111111
     112= 5.4.10 =
     113* Fix - language loading path
     114
    112115= 5.4.9 =
    113116* Tag - WooCommerce 9.7
  • woorewards/trunk/woorewards.php

    r3253191 r3253331  
    77 * Author: Long Watch Studio
    88 * Author URI: https://longwatchstudio.com
    9  * Version: 5.4.9
     9 * Version: 5.4.10
    1010 * License: Copyright LongWatchStudio 2022
    1111 * Text Domain: woorewards-lite
     
    111111    private function defineConstants()
    112112    {
    113         define('LWS_WOOREWARDS_VERSION', '5.4.9');
     113        define('LWS_WOOREWARDS_VERSION', '5.4.10');
    114114        define('LWS_WOOREWARDS_FILE', __FILE__);
    115115        define('LWS_WOOREWARDS_DOMAIN', 'woorewards-lite');
     
    149149    public function addPluginVersion($url)
    150150    {
    151         return '5.4.9';
     151        return '5.4.10';
    152152    }
    153153
Note: See TracChangeset for help on using the changeset viewer.