-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct-brands.php
63 lines (52 loc) · 2.09 KB
/
product-brands.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
<?php
/*
Plugin Name: WooCommerce Product Brand
Plugin URI: https://frydigital.com/plugins/fd-product-brands/
Description: A WooCommerce plugin that adds a custom taxonomy 'product_brand' to products and allows the attachment of images to the product_brand. Each image links to a search result for that taxonomy.
Version: 1.0.15
Author: Fry Digital
Author URI: https://frydigital.com/
License: GPLv3
*/
// Define the class that extends WooCommerce_Product_Brand
require_once(plugin_dir_path(__FILE__) . 'includes/class-product-brand.php');
require_once(plugin_dir_path(__FILE__) . 'includes/class-product-brand-shortcode.php');
require_once(plugin_dir_path(__FILE__) . 'includes/class-product-brand-admin.php');
require_once(plugin_dir_path(__FILE__) . 'includes/class-product-brand-meta.php');
function my_plugin_activation_hook() {
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die( 'Sorry, but this plugin requires WooCommerce to be installed and activated.' );
}
}
register_activation_hook( __FILE__, 'my_plugin_activation_hook' );
// Define the function that registers the plugin
function my_product_brand_plugin() {
// Create an instance of the My_Product_Brand class
new WooCommerce_Product_Brand();
new Product_Brand_Meta();
new WooCommerce_Product_Brand_Shortcode();
//new Product_Brand_Admin();
}
// Hook the my_product_brand_plugin function to the plugins_loaded hook
add_action('plugins_loaded', 'my_product_brand_plugin');
/**
*
* Plugin update checker
*
* Check for Github version release and update
* https://github.com/YahnisElsts/plugin-update-checker
*
* @since 1.0.2
*/
require 'plugin-update-checker/plugin-update-checker.php';
use YahnisElsts\PluginUpdateChecker\v5\PucFactory;
$myUpdateChecker = PucFactory::buildUpdateChecker(
'https://github.com/arbutusroutes/fd-product-brands/',
__FILE__,
'fd-product-brands'
);
//Github Releases
$myUpdateChecker->getVcsApi()->enableReleaseAssets();
//Set the branch that contains the stable release.
$myUpdateChecker->setBranch('master');