-
Notifications
You must be signed in to change notification settings - Fork 19
/
wp-dispensary.php
114 lines (102 loc) · 3.18 KB
/
wp-dispensary.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/**
* CannaBiz Menu
*
* Plugin details
*
* @package CannaBiz_Menu
* @author CannaBiz Software <contact@cannabizsoftware.com>
* @license GPL-3.0+ http://www.gnu.org/licenses/gpl-3.0.txt
* @link https://cannabizsoftware.com
* @since 1.0
*
* Plugin Name: CannaBiz Menu
* Plugin URI: https://cannabizsoftware.com/menu/
* Description: The complete marijuana menu solution for dispensaries and delivery services
* Version: 4.5.0
* Author: CannaBiz Software
* Author URI: https://cannabizsoftware.com
* License: GPL-3.0+
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* Text Domain: cannabiz-menu
* Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
wp_die();
}
// Define the plugin version.
define( 'WP_DISPENSARY_VERSION', '4.5.0' );
// Define the plugin base name.
$plugin_name = plugin_basename( __FILE__ );
/**
* The code that runs during plugin activation.
*
* This action is documented in includes/class-wp-dispensary-activator.php
*
* @access public
*
* @return void
*/
function activate_wp_dispensary() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-dispensary-activator.php';
wp_dispensary_activator::activate();
}
/**
* The code that runs during plugin deactivation.
*
* This action is documented in includes/class-wp-dispensary-deactivator.php
*
* @access public
*
* @return void
*/
function deactivate_wp_dispensary() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-dispensary-deactivator.php';
wp_dispensary_deactivator::deactivate();
}
// Registers the plugin activation hook.
register_activation_hook( __FILE__, 'activate_wp_dispensary' );
// Registers the plugin deactivation hook.
register_deactivation_hook( __FILE__, 'deactivate_wp_dispensary' );
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-wp-dispensary.php';
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
* @return void
*/
function run_wp_dispensary() {
$plugin = new wp_dispensary();
$plugin->run();
}
// Runs WP Dispensary.
run_wp_dispensary();
/**
* Add settings link on plugin page
*
* @param array $links an array of links related to the plugin.
*
* @since 1.9.8
* @return array
*/
function wpd_plugin_links( $links ) {
$pro_link = '<a href="https://cannabizsoftware.com/product/pro-package/" target="_blank" style="font-weight:700;">' . esc_attr__( 'Go Pro', 'cannabiz-menu' ) . '</a>';
$settings_link = '<a href="admin.php?page=wpd-settings">' . esc_attr__( 'Settings', 'cannabiz-menu' ) . '</a>';
// Updated links.
array_unshift( $links, $settings_link );
// Updated links (Pro).
if ( ! function_exists( 'wpd_ecommerce' ) ) {
array_unshift( $links, $pro_link );
}
return $links;
}
add_filter( "plugin_action_links_$plugin_name", 'wpd_plugin_links' );