-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion-switcher.php
More file actions
61 lines (53 loc) · 1.66 KB
/
Copy pathversion-switcher.php
File metadata and controls
61 lines (53 loc) · 1.66 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
<?php
/**
* Plugin Name: Version Switcher
* Description: This is a very simple plugin which will help you to switch instantly between all plugin's version which exists in WordPress org and there is no anxiety about download and upload task because just one click will do that for you.
* Author: IqbalRony
* Author URI: http://www.iqbalrony.com
* Version: 1.0.3
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: version-switcher
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
die;
}
define( 'IRVS_VERSION', '1.0.3' );
define( 'IRVS__FILE__', __FILE__ );
define( 'IRVS_DIR_PATH', plugin_dir_path( IRVS__FILE__ ) );
define( 'IRVS_KEY', 'irvs_version_switcher_' );
/**
* Get plugin path.
*/
if ( ! function_exists( 'irvs_get_plugin_path' ) ) {
function irvs_get_plugin_path( $file ) {
return IRVS_DIR_PATH . $file;
}
}
/**
* Get plugin url.
*/
if ( ! function_exists( 'irvs_plugin_url' ) ) {
function irvs_plugin_url( $url ) {
return plugins_url( $url, IRVS__FILE__ );
}
}
/**
* defining plugin menu page slug.
*/
if ( ! defined( 'IRVS_MENU_PAGE_SLUG' ) ) {
$menu_slug = sanitize_key( 'version-switcher' );
define( 'IRVS_MENU_PAGE_SLUG', $menu_slug );
}
/**
* Start the journey of version switcher.
*/
function irvs_start_version_switch() {
require_once( irvs_get_plugin_path( 'inc/plugin.php' ) );
require_once( irvs_get_plugin_path( 'inc/functions.php' ) );
IqbalRony\VersionSwitcher\VersionSwitcher::instance()->init();
}
add_action( 'plugins_loaded', 'irvs_start_version_switch' );
// Delete all the cash of this plugin from database
register_deactivation_hook( __FILE__, 'irvs_delete_all_cache' );