-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtranslentor.php
62 lines (48 loc) · 1.75 KB
/
translentor.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
57
58
59
60
61
62
<?php
/**
* Plugin Name: Translentor
* Plugin URI: https://translentor.com
* Description: This plugin adds a language translator widget to the Elementor Page Builder.
* Version: 1.6.1
* Author: Translentor
* Author URI: https://translentor.com
* Domain Path: translentor
* @package Translentor
*/
define( 'translentor_DIR_Main', plugin_dir_path( __FILE__ ) );
define( 'translentor_URL', plugin_dir_url( __FILE__ ) );
define( 'translentor_VERSION', '1.6.1' );
define( 'translentor_slug', 'translentor' );
define('translentor_category_icon', 'fa fa-plug');
define('translentor_category', 'Translator');
use Elementor\Plugin;
function cyb_activation_redirect( $plugin ) {
if( $plugin == plugin_basename( __FILE__ ) ) {
exit( wp_redirect( admin_url( 'admin.php?page=translentor-module' ) ) );
}
}
add_action( 'elementor/elements/categories_registered', function ()
{
$elementsManager = Plugin::instance()->elements_manager;
$elementsManager->add_category
(
'translentor-category',
array(
'title' => translentor_category,
'icon' => translentor_category_icon,
)
);
});
//require_once translentor_DIR_Main .'translentor/translentor.php';
require_once translentor_DIR_Main .'widgets/index.php';
function translentor_admin_notices() {
if(!class_exists( 'Elementor\Plugin' ) )
{
?>
<div class="notice notice-warning is-dismissible">
<p><strong>Warning</strong>: Translentor work with Elementor Plugin. Please Activate Elementor Plugin</p>
</div>
<?php
}
}
add_action('admin_notices', 'translentor_admin_notices');