Plugin code
This commit is contained in:
parent
8819c70d0e
commit
2fde6edfdc
28 changed files with 6338 additions and 0 deletions
69
woocommerce-direct-links.php
Normal file
69
woocommerce-direct-links.php
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
/**
|
||||
* Woocomerce Direct Links
|
||||
*
|
||||
* @category Wordpress_Plugin
|
||||
* @package Woocommerce_Direct_Links
|
||||
* @author Joel Sanguenza <joel@chykalophia.com>
|
||||
* Lord Francis Navarro <francis@chykalophia.com>
|
||||
* @license GPL-2.0+ http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
* @link https://chykalophia.com/woocommerce-direct-links
|
||||
* @since 0.1.0
|
||||
*
|
||||
* @wordpress-plugin
|
||||
* Plugin Name: WooCommerce Direct Links
|
||||
* Plugin URI: https://chykalophia.com/woocommerce-direct-links
|
||||
* Description: An extension plugin for Woocommerce which displays the list of products (simple and variable products) and its variations along with its add-to-cart links. These links automatically adds the product or product variation to the cart and redirects the user to the checkout page. You may choose from two (2) url shorteners (Tinyurl and Bitly) to shrink the links.
|
||||
* Version: 0.1.0
|
||||
* Author: Joel Sanguenza, Lord Francis Navarro
|
||||
* Author URI: https://chykalophia.com
|
||||
* License: GPL-2.0+
|
||||
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
* Text Domain: woocommerce-direct-links
|
||||
* Domain Path: /languages
|
||||
*/
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
}
|
||||
|
||||
/**
|
||||
* Current plugin version.
|
||||
*/
|
||||
define('WDL_VERSION', '0.1.0');
|
||||
|
||||
// Constants.
|
||||
define('CKLPH_WDL_URL', plugin_dir_url(__FILE__));
|
||||
define('CKLPH_WDL_PATH', plugin_dir_path(__FILE__));
|
||||
define('CKLPH_WDL_BASE', plugin_basename(__FILE__));
|
||||
|
||||
/**
|
||||
* The code that runs during plugin activation.
|
||||
*/
|
||||
function cklph_wdl_activate()
|
||||
{
|
||||
flush_rewrite_rules();
|
||||
}
|
||||
register_activation_hook(__FILE__, 'cklph_wdl_activate');
|
||||
register_deactivation_hook(__FILE__, 'cklph_wdl_activate');
|
||||
|
||||
|
||||
/**
|
||||
* The core plugin class that is used to define internationalization,
|
||||
* admin-specific hooks, and public-facing site hooks.
|
||||
*/
|
||||
require CKLPH_WDL_PATH . 'includes/class-cklph-wdl.php';
|
||||
|
||||
/**
|
||||
* Begins execution of the plugin.
|
||||
*
|
||||
* @since 0.1.0
|
||||
*/
|
||||
function run_wdl()
|
||||
{
|
||||
$plugin = new Cklph_Wdl(); // To be updated into a singleton class.
|
||||
$plugin->run();
|
||||
}
|
||||
|
||||
run_wdl();
|
Loading…
Add table
Add a link
Reference in a new issue