-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustuno.php
59 lines (53 loc) · 1.45 KB
/
justuno.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
<?php
/**
* @package Justuno
*/
/*
Plugin Name: Justuno
Plugin URI: https://www.justuno.com
Description: Grow your social audience, email subscribers & sales!
Version: 2.8
Author: Justuno
Author URI: http://www.justuno.com
License: GPLv2 or later
*/
include_once dirname(__FILE__) . '/includes/AdminPage.php';
if (!function_exists('justuno_activation')) {
register_activation_hook(__FILE__, 'justuno_activation');
function justuno_activation()
{
// send any api calls when activation
update_option('justuno_api_key', '');
update_option('justuno_woocommerce_token', '');
}
}
if (!function_exists('justuno_deactivation')) {
register_deactivation_hook(__FILE__, 'justuno_deactivation');
function justuno_deactivation()
{
delete_option('justuno_options');
}
}
if (is_admin()) {
require_once dirname(__FILE__) . '/includes/AdminPage.php';
} else {
require_once dirname(__FILE__) . '/includes/Frontend.php';
}
add_filter('plugin_action_links_justuno/justuno.php', 'nc_settings_link');
function nc_settings_link($links)
{
// Build and escape the URL.
$url = esc_url(add_query_arg(
'page',
'justuno-settings-conf',
get_admin_url() . 'options-general.php'
));
// Create the link.
$settings_link = "<a href='$url'>" . __('Settings') . '</a>';
// Adds the link to the end of the array.
array_push(
$links,
$settings_link
);
return $links;
}