ADD loader .php
This commit is contained in:
parent
8fee22e73d
commit
add4650840
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: Audio diary
|
||||
Description: پلاگین دفترچه خاطرات.
|
||||
Author: haakel
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
echo "what the hell are you doing here?";
|
||||
exit;
|
||||
}
|
||||
|
||||
class Audio_diary{
|
||||
/**
|
||||
* Initiator
|
||||
*
|
||||
* @return object Initialized object of class.
|
||||
*
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
public function __construct(){
|
||||
$this->define_constants();
|
||||
$this->Audio_diary_loader();
|
||||
}
|
||||
public function define_constants() {
|
||||
|
||||
/**
|
||||
* Defines all constants
|
||||
*
|
||||
*/
|
||||
define( 'AUDIO_DIARY_VERSION', '1.0.0' );
|
||||
define( 'AUDIO_DIARY_FILE', __FILE__ );
|
||||
define( 'AUDIO_DIARY_PATH', plugin_dir_path( AUDIO_DIARY_FILE ) );
|
||||
define( 'AUDIO_DIARY_BASE', plugin_basename( AUDIO_DIARY_FILE ) );
|
||||
define( 'AUDIO_DIARY_SLUG', 'Audio_diary_settings' );
|
||||
define( 'AUDIO_DIARY_SETTINGS_LINK', admin_url( 'admin.php?page=' . AUDIO_DIARY_SLUG ) );
|
||||
define( 'AUDIO_DIARY_CLASSES_PATH', AUDIO_DIARY_PATH . 'classes/' );
|
||||
define( 'AUDIO_DIARY_IMAGES', AUDIO_DIARY_PATH . 'build/images' );
|
||||
define( 'AUDIO_DIARY_MODULES_PATH', AUDIO_DIARY_PATH . 'modules/' );
|
||||
define( 'AUDIO_DIARY_URL', plugins_url( '/', AUDIO_DIARY_FILE ) );
|
||||
}
|
||||
/**
|
||||
* Require loader Audio diary class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function Audio_diary_loader() {
|
||||
require AUDIO_DIARY_CLASSES_PATH .'class_Audio_diary_loader.php';
|
||||
}
|
||||
}
|
||||
|
||||
Audio_diary::get_instance();
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
echo "what the hell are you doing here?";
|
||||
exit;
|
||||
}
|
||||
|
||||
class Audio_Diary_loader{
|
||||
/**
|
||||
* Instance
|
||||
*
|
||||
* @access private
|
||||
* @var object Class object.
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*
|
||||
* @return object Initialized object of class.
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->load_dependencies();
|
||||
}
|
||||
/**
|
||||
* Load the required dependencies for this plugin.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access private
|
||||
*/
|
||||
private function load_dependencies() {
|
||||
|
||||
require_once AUDIO_DIARY_CLASSES_PATH . '';
|
||||
require_once AUDIO_DIARY_CLASSES_PATH . '';
|
||||
|
||||
// The class responsible for the settings page
|
||||
require_once AUDIO_DIARY_CLASSES_PATH . '';
|
||||
|
||||
// The class responsible for defining main options of the plugin.
|
||||
require_once AUDIO_DIARY_CLASSES_PATH . '';
|
||||
|
||||
// The class responsible for defining REST Routs API of the plugin.
|
||||
require_once AUDIO_DIARY_CLASSES_PATH . '';
|
||||
|
||||
// The class responsible for defining all actions for edd.
|
||||
|
||||
require_once AUDIO_DIARY_MODULES_PATH . '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Audio_Diary_loader::get_instance();
|
||||
Loading…
Reference in New Issue