Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Classe AddScripts */
- namespace Info_Azienda;
- class Add_Scripts
- {
- public function __construct() {
- add_action('wp_enqueue_scripts', array($this, "Add_Scripts_Plugin_Template"), 10 );
- }
- public function Add_Scripts_Plugin_Template() {
- if(is_admin()){
- wp_enqueue_script('info-azienda-js', PLUGIN_DIR_URL . 'assets/js/index.js', array(), 1.0, true);
- wp_enqueue_style('info-azienda-css', PLUGIN_DIR_URL . 'assets/css/main.css', array(), 1.0);
- }
- }
- }
- /*--------------------------------------------------------------------------------------------------------------------------------*/
- /*Classe Info_azienda*/
- /**
- * classe principale starter plugin
- **/
- namespace Info_Azienda;
- require_once(PLUGIN_DIR_API_PATH . '/includes/class-info.php');
- require_once(PLUGIN_DIR_API_PATH . '/includes/class-template-add.php');
- require_once(PLUGIN_DIR_API_PATH . '/includes/class-add-scripts.php');
- class Info_azienda{
- private $versione;
- public function __construct(){
- $this->versione = Info::VERSIONE;
- //inserire gli hooks che preferisci
- $this->LoadDipendenze();
- }
- public function LoadDipendenze(){
- $TemplateAdd = new Tempate_Creator();
- $script = new Add_Scripts();
- }
- }
- /*-------------------------------------------------------------------------------------------------------------------------*/
- /*File Starter Plugin*/
- namespace Info_Azienda;
- if (!defined('WPINC')) {
- die;
- }
- Define('PLUGIN_DIR_URL' , plugin_dir_url(__FILE__));
- Define("PLUGIN_DIR_API_PATH", plugin_dir_path(__FILE__));
- register_activation_hook( __FILE__, __NAMESPACE__ . '\\activation' );
- function activation(){
- require_once(PLUGIN_DIR_API_PATH . '/includes/class-activator.php');
- Activator::attivazione();
- }
- register_deactivation_hook( __FILE__, __NAMESPACE__ .'\\deactivation' );
- function deactivation(){
- require_once( PLUGIN_DIR_API_PATH . 'includes/class-deactivator.php');
- Deactivator::disattivazione();
- }
- require_once( PLUGIN_DIR_API_PATH . '/includes/class-plugin.php');
- $starter = new Info_azienda();
- ?>
Add Comment
Please, Sign In to add comment