-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxsmartlink.php
More file actions
81 lines (70 loc) · 1.96 KB
/
xsmartlink.php
File metadata and controls
81 lines (70 loc) · 1.96 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* Plugin Name: xSmart Link
* Plugin URI: https://github.com/KomAuras/xsmartlink/
* Description: Smart link posts plugin
* Version: 2.1.4
* Author: Evgeny Stefanenko
* Author URI: http://www.clarionlife.net
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: xsmartlink
* Domain Path: /languages
*/
namespace SmartLink;
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
// Composer autoloader
//require __DIR__ . '/vendor/autoload.php';
// The class that contains the plugin info.
require_once plugin_dir_path(__FILE__) . 'includes/class-info.php';
/**
* The code that runs during plugin activation.
*/
function activation()
{
require_once plugin_dir_path(__FILE__) . 'includes/class-activator.php';
Activator::activate();
}
register_activation_hook(__FILE__, __NAMESPACE__ . '\\activation');
/**
* Check for updates.
*/
require_once plugin_dir_path(__FILE__) . 'includes/vendor/plugin-update-checker/plugin-update-checker.php';
$myUpdateChecker = \Puc_v4_Factory::buildUpdateChecker(
Info::UPDATE_URL,
__FILE__,
Info::SLUG
);
//Optional: If you're using a private repository, specify the access token like this:
//$myUpdateChecker->setAuthentication('your-token-here');
//Optional: Set the branch that contains the stable release.
$myUpdateChecker->setBranch('master');
/**
* Run the plugin.
*/
function run()
{
require_once plugin_dir_path(__FILE__) . 'includes/class-plugin.php';
$plugin = new Plugin();
$plugin->run();
}
/**
* Add debug function
* use as: _log('log message');
*/
if (!function_exists('_log')) {
function _log($message)
{
if (WP_DEBUG === true) {
if (is_array($message) || is_object($message)) {
error_log(print_r($message, true));
} else {
error_log($message);
}
}
}
}
run();