<?php
/*
Plugin Name: Linksgarden
Plugin URI: https://www.linksgarden.com/
Description: Plugin pour éditeurs Linksgarden
Author: Linksgarden
Version: 1.2.2
Author URI: https://www.linksgarden.com/
*/

defined( 'WPINC' ) or die;

define ('LG_PLUGIN_DIR', plugin_dir_path(__FILE__));
define ('LG_PLUGIN_NAME', plugin_basename(__FILE__));
define ('LG_PLUGIN_FILE', __FILE__);

/*
 * Se lance lorsque l'on active le plugin
 */
function linksgarden_activate(){
    require_once LG_PLUGIN_DIR.'modele/LinksgardenActivate.php';
    LinksgardenActivate::activate();
}

/*
 * Se lance lorsque l'on desactive le plugin
 */
function linksgarden_deactivate(){
    require_once LG_PLUGIN_DIR.'modele/LinksgardenDeactivate.php';
    LinksgardenDeactivate::deactivate();
}

/*
 * Se lance lorsque l'on desinstalle le plugin
 */
function linksgarden_uninstall(){
    require_once LG_PLUGIN_DIR.'modele/LinksgardenUninstall.php';
    LinksgardenUninstall::uninstall();
}

require_once LG_PLUGIN_DIR.'modele/LinksgardenConfig.php';
LinksgardenConfig::init();

/*
 * Hooks
 */
register_activation_hook( __FILE__, 'linksgarden_activate' );
register_deactivation_hook( __FILE__, 'linksgarden_deactivate' );
register_uninstall_hook( __FILE__, 'linksgarden_uninstall' );

require_once LG_PLUGIN_DIR.'modele/LinksgardenRest.php';
LinksgardenRest::init();
