Plugin = new stdClass; $this->Form = new stdClass; $this->Site = new stdClass; $this->Env = new stdClass; $this->User = new stdClass; $this->Links = new stdClass; $this->ThirdParty = new stdClass; $this->Api = new stdClass; $this->Helper = new stdClass; } public function init() { add_action( 'plugins_loaded' , array( $this , 'plugins_loaded' ) , 20 ); add_action( 'setup_theme' , array( $this , 'setup_theme' ) , 20 ); add_action( 'after_setup_theme' , array( $this , 'after_setup_theme' ) , 20 ); add_action( 'init' , array( $this , 'wp_init' ) , 20 ); add_action( 'wp_loaded' , array( $this , 'wp_loaded' ) , 20 ); } public function plugins_loaded() { $this->define_constants(); $this->includes(); do_action( $this->ltd . '_plugins_loaded' ); } private function define_constants() { $this->name = 'Announce from the Dashboard'; $this->ver = '1.5.1'; $this->plugin_slug = 'announce-from-the-dashboard'; $this->main_slug = 'announce_from_the_dashboard'; $this->ltd = 'afd'; $this->plugin_dir = plugin_dir_path( __FILE__ ); $this->plugin_url = plugin_dir_url( __FILE__ ); load_plugin_textdomain( $this->ltd , false , $this->plugin_slug . '/languages' ); include_once( $this->plugin_dir . 'core/api.php' ); include_once( $this->plugin_dir . 'core/helper.php' ); $this->Api = new Afd_Api(); $this->Helper = new Afd_Helper(); } private function includes() { $includes = array( 'core/init.php', 'core/init_add.php', 'third_party/third_party.php', 'admin/master.php', ); $this->Helper->includes( $includes ); } public function setup_theme() { do_action( $this->ltd . '_setup_theme' ); } public function after_setup_theme() { do_action( $this->ltd . '_after_setup_theme' ); } public function wp_init() { do_action( $this->ltd . '_init' ); } public function wp_loaded() { do_action( $this->ltd . '_after_init' ); } } $GLOBALS['Afd'] = new Afd(); $GLOBALS['Afd']->init(); endif;