403Webshell
Server IP : 104.26.4.103  /  Your IP : 216.73.216.4
Web Server : nginx/1.27.1
System : Linux in-5 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
User : arabianexpress ( 1872)
PHP Version : 8.0.30
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /storage/v9321/rimskannur/public_html/wp-content/plugins/wp-rollback/src/PluginSetup/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /storage/v9321/rimskannur/public_html/wp-content/plugins/wp-rollback/src/PluginSetup/Language.php
<?php

/**
 * Language setup.
 *
 * This class is used to manage the application language.
 *
 * @package WpRollback\PluginSetup
 * @since 3.0.0
 */

declare(strict_types=1);

namespace WpRollback\Free\PluginSetup;

use WpRollback\Free\Core\Constants;
use WpRollback\SharedCore\Core\SharedCore;

/**
 * Class Language.
 *
 * @since 3.0.0
 */
class Language
{
    /**
     * @since 3.0.0
     */
    public static function load(): void
    {
        $constants = SharedCore::container()->make(Constants::class);
        $pluginRelativePath = self::getRelativePath($constants);

        $locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale();
        // Traditional WordPress plugin locale filter.
        $locale = apply_filters('plugin_locale', $locale, $constants->getTextDomain());

        // Setup paths to current locale file.
        $moFile = sprintf('%1$s-%2$s.mo', $constants->getTextDomain(), $locale);
        $moFileLocal = trailingslashit(WP_PLUGIN_DIR) . $pluginRelativePath . $moFile;
        $moFileGlobal = trailingslashit(WP_LANG_DIR) . 'plugins/' . $moFile;

        unload_textdomain($constants->getTextDomain());
        if (file_exists($moFileGlobal)) {
            // Look in global /wp-content/languages/plugins folder.
            load_textdomain($constants->getTextDomain(), $moFileGlobal);
        } elseif (file_exists($moFileLocal)) {
            // Look in local /wp-content/plugins/wp-rollback/languages/ folder.
            load_textdomain($constants->getTextDomain(), $moFileLocal);
        } else {
            // Load the default language files.
            load_plugin_textdomain($constants->getTextDomain(), false, $pluginRelativePath);
        }
    }

    /**
     * Return the plugin language dir relative path, e.g. "wp-rollback/languages/"
     *
     * @since 3.0.0
     */
    public static function getRelativePath(Constants $constants): string
    {
        $pluginRelativePath = dirname(plugin_basename($constants->getPluginFile())) . '/languages/';
        $pluginRelativePath = ltrim(apply_filters('wprollback_languages_directory', $pluginRelativePath), '/\\');

        return trailingslashit($pluginRelativePath);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit