-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.php
More file actions
51 lines (44 loc) · 1.4 KB
/
Application.php
File metadata and controls
51 lines (44 loc) · 1.4 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
<?php
namespace WP_JSON_LD;
// var_dump('2<pre>');
// var_dump(__NAMESPACE__); //die();
$obj = new Loader();
// $obj->test();
use Intraxia\Jaxion\Core\Application as JaxionCore;
// use Intraxia\Jaxion\Contract\Core\Application as ApplicationContract;
class Application extends JaxionCore
{
public $ver = JSON_LD_VERSION;
/**
* ServiceProviders to register with the Application.
*
* @var string[]
*/
protected $providers = array(
'WP_JSON_LD\Core\Providers\Object',
);
/**
* {@inheritdoc}
*/
public function activate()
{
global $wp_rewrite;
define('VERSION', $ver);
$current_version = VERSION; // define this constant in the loader file
$saved_version = get_option('wp_json_ld_version');
// This is a new installation
if (!$saved_version) {
// Do whatever you need to do during first installation
$wp_rewrite->flush_rules(false);
// This is an upgrade
} elseif (version_compare($saved_version, $current_version, '<')) {
// Do whatever you need to do on an upgrade
$wp_rewrite->flush_rules(false);
// Version is up to date - do nothing
} else {
return;
}
// Update the version number stored in the db (so this does not run again)
update_option('wp_json_ld_version', JSON_LD_VERSION);
}
}