Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (60 sloc) 1.71 KB
<?php
/*
* Plugin Name: {FstarterPlugin}
* Plugin URI: {http://Fstarter.uri}
* Description: {FstarterDescription}
* Version: {0.0.0}
* Author: {FstarterAuthor)
* Author URI: (http://FstarterAuthor.uri)
* License: {GPLv2 or later)
* Text Domain: {FstarterDomain}
*/
/* Don't access this file directly */
if(!defined('ABSPATH')){die;}
/* Dir Path constant */
define('FSTARTER_PATH', trailingslashit(plugin_dir_path( __FILE__ )));
/* Dir URL constant */
define('FSTARTER_URL', trailingslashit(plugin_dir_url(__FILE__)));
/* Dir text domain */
define('FSTARTER_DOMAIN', 'fstarter');
/* Database wp_options table options prefix */
define('FSTARTER_PREFIX', 'fstarter');
/* Composer Autoload */
if(file_exists(FSTARTER_PATH . 'vendor/autoload.php')){
require_once(FSTARTER_PATH . 'vendor/autoload.php');
}
/**
* Call the hook when Plugin is activated
* @return Void
*/
function fstarter_activate_plugin()
{
Inc\Hooks\ActivationHook::run();
}
register_activation_hook(__FILE__, 'fstarter_activate_plugin');
function fstarter_deactivate_plugin()
{
Inc\Hooks\DeactivationHook::run();
}
register_deactivation_hook(__FILE__, 'fstarter_deactivate_plugin');
/**
* Main call of the Plugin, it register all the plugin's services
* @var String pointing to the ServiceProvider class
*/
if(class_exists('Inc\\ServiceProvider')){
Inc\ServiceProvider::register_services();
}
/**
* Ajax triggerer.
* @return Void
*/
function fstarter_ajax_triggerer(){
$class = 'Inc\\Ajax\\' . $_POST["class"];
if(class_exists($class)){
$class = new $class();
$class->action($_POST);
}
wp_die();
}
add_action('wp_ajax_fstarter_ajax_triggerer', 'fstarter_ajax_triggerer');
add_action('wp_ajax_nopriv_fstarter_ajax_triggerer', 'fstarter_ajax_triggerer');
You can’t perform that action at this time.