-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathplugin.php
41 lines (34 loc) · 1.56 KB
/
plugin.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
<?php
/**
* Plugin Name: AVC WP Parser
* Description: Create a plugin/theme/composer-package source reference site powered by WordPress
* Author: Evan Shaw, Ryan McCue, Paul Gibbs, Andrey "Rarst" Savchenko and Contributors
* Author URI: https://github.com/aivec/phpdoc-parser/graphs/contributors
* Plugin URI: https://github.com/aivec/phpdoc-parser
* Version: %%VERSION%%
* Text Domain: wp-parser
* Domain Path: /languages/
*/
define('AVC_WP_PARSER', true);
define('AVCPDP_VERSION', '%%VERSION%%');
define('AVCPDP_LANG_DIR', __DIR__ . '/languages');
define('AVCPDP_PLUGIN_DIR', ABSPATH . 'wp-content/plugins/' . plugin_basename(dirname(__FILE__)));
define('AVCPDP_PLUGIN_URL', site_url() . '/wp-content/plugins/' . plugin_basename(dirname(__FILE__)));
define('AVCPDP_DIST_DIR', AVCPDP_PLUGIN_DIR . '/dist');
define('AVCPDP_DIST_URL', AVCPDP_PLUGIN_URL . '/dist');
load_plugin_textdomain('wp-parser', false, dirname(plugin_basename(__FILE__)) . '/languages');
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require __DIR__ . '/vendor/autoload.php';
}
(new Aivec\Plugins\DocParser\Master())->init();
register_activation_hook(__FILE__, ['P2P_Storage', 'init']);
register_activation_hook(__FILE__, ['P2P_Storage', 'install']);
register_activation_hook(__FILE__, function () {
(new Aivec\Plugins\DocParser\Registrations())->registerPostTypes();
flush_rewrite_rules();
});
register_deactivation_hook(__FILE__, function () {
flush_rewrite_rules();
});
// TODO safer handling for uninstall
// register_uninstall_hook( __FILE__, array( 'P2P_Storage', 'uninstall' ) );