-
Notifications
You must be signed in to change notification settings - Fork 0
/
wc1c-extension-support-1251.php
56 lines (47 loc) · 1.5 KB
/
wc1c-extension-support-1251.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Plugin Name: WC1C > extension - Support Windows-1251
* Plugin URI: https://wc1c.info/extensions/support-windows-1251
* Description: Getting rid of incomprehensible hieroglyphs for old versions of 1C.
* Version: 0.11.0
* Requires at least: 5.2
* Requires PHP: 7.0
* Requires WC1C: 0.19
* WC1C tested up to: 0.21
* Text Domain: wc1c-support-1251
* Author: WC1C team
* Author URI: https://wc1c.info
* Domain Path: /assets/languages
* Copyright: WC1C team © 2018-2023
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* @package Wc1c\Extensions
*/
defined('ABSPATH') || exit;
function wc1c_extension_support_1251_init($extensions)
{
$extension_id = 'support-1251';
if(isset($extensions[$extension_id]))
{
return $extensions;
}
define('WC1C_EXTENSION_SUPPORT_1251_DIR', __DIR__);
define('WC1C_EXTENSION_SUPPORT_1251_PLUGIN_URL', plugin_dir_url(__FILE__));
wc1c()->context()->loader()->addNamespace('Wc1c\Extensions\Support1251', WC1C_EXTENSION_SUPPORT_1251_DIR . '/src');
try
{
$extension = new Wc1c\Extensions\Support1251\Core();
}
catch(\Throwable $e)
{
return $extensions;
}
$extension->setId($extension_id);
$extension->localization();
$extension->loadMetaByPlugin(__FILE__, 'wc1c-support-1251');
$extension->setMeta('name', __('Support Windows-1251', 'wc1c-support-1251'));
$extensions[$extension_id] = $extension;
return $extensions;
}
add_filter('wc1c_extensions_loading', 'wc1c_extension_support_1251_init', 10, 1);