loader = new LFZW_Fr_Loader(); $this->plugin_locale = new LFZW_Fr_Locale( ); $this->plugin_admin = new LFZW_Fr_Admin( ); $this->plugin_public = new LFZW_Fr_Public( ); new LFZW_Fr_Ajax_Handler( ); new LFZW_Fr_Admin_Ajax_Handler( ); } /** * Define the locale for this plugin for internationalization. * Set the domain and to register the hook with WordPress. * * @since 1.0.0 * @return void */ private function set_locale() { $this->loader->add_action( 'plugins_loaded', $this->plugin_locale, 'load_plugin_textdomain' ); } /** * Register all of the hooks related to the admin area functionality of the plugin. * * @since 1.0.0 * @return void */ private function define_admin_hooks() { $this->loader->add_action( 'admin_enqueue_scripts', $this->plugin_admin, 'enqueue_styles' ); $this->loader->add_action( 'admin_enqueue_scripts', $this->plugin_admin, 'enqueue_scripts' ); $this->loader->add_action( 'admin_menu', $this->plugin_admin, 'add_admin_menu' ); } /** * Register all of the hooks related to the public-facing functionality of the plugin. * * @since 1.0.0 * @return void */ private function define_public_hooks() { $this->loader->add_action( 'wp_enqueue_scripts', $this->plugin_public, 'enqueue_styles' ); $this->loader->add_action( 'wp_enqueue_scripts', $this->plugin_public, 'enqueue_scripts' ); } /** * Add all the shortcodes required in public area * * @since 1.0.0 * @return void */ private function add_shortcodes() { add_shortcode('lfzw_listings', [$this->plugin_public, 'load_all_listings']); } /** * Load the dependencies and instantiate plugin objects. * Set the hooks for the admin area and the public-facing side of the site. * Run the loader to execute all of the hooks with WordPress. * * @since 1.0.0 * @return void */ public function init() { $this->load_dependencies(); $this->instantiate_plugin(); $this->set_locale(); $this->define_admin_hooks(); $this->define_public_hooks(); $this->add_shortcodes(); $this->loader->run(); } }