Skip to content

Instantly share code, notes, and snippets.

@BFTrick
Created April 6, 2024 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BFTrick/28668090fa177608ba5918518805d3d8 to your computer and use it in GitHub Desktop.
Save BFTrick/28668090fa177608ba5918518805d3d8 to your computer and use it in GitHub Desktop.
Packt Mastering WooCommerce - Example WooCommerce Plugin
<?php
/*
* Plugin Name: WooCommerce Example Plugin
* Requires Plugins: woocommerce
* Plugin URI: http://speakinginbytes.com
* Description: Our custom WooCommerce functionality
* Version: 2.0
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: woocommerce-example-plugin
* Domain Path: /languages
*/
// only run if there's no other class with this name
if ( ! class_exists('WC_Example')){
class WC_Example{
public function __construct(){
// add more code here
}
}
// Start running our plugin
$GLOBALS['wc_example'] = new WC_Example();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment