classes/setup.class.php'; require_once SP_PC_PATH . '/public/helpers/sp-pc-output.php'; /** * The class responsible for defining all actions that occur in the public-facing * side of the site. */ require_once SP_PC_PATH . 'public/class-smart-post-show-public.php'; require_once SP_PC_PATH . 'admin/preview/class-spsp-preview.php'; /** * The class responsible for review notice. */ require_once SP_PC_PATH . 'admin/views/notices/review.php'; // Elementor shortcode addons. require_once ABSPATH . 'wp-admin/includes/plugin.php'; if ( ( is_plugin_active( 'elementor/elementor.php' ) || is_plugin_active_for_network( 'elementor/elementor.php' ) ) ) { require_once SP_PC_PATH . 'admin/class-smart-post-show-element-shortcode-addons.php'; require_once SP_PC_PATH . 'admin/class-smart-post-show-element-shortcode-addons-deprecated.php'; } /** * Gutenberg block. */ if ( version_compare( $GLOBALS['wp_version'], '5.3', '>=' ) ) { require_once SP_PC_PATH . 'admin/class-smart-post-show-gutenberg-block.php'; new Smart_Post_Show_Gutenberg_Block(); } } /** * Define the locale for this plugin for internationalization. * * Uses the Smart_Post_Show_i18n class in order to set the domain and to register the hook * with WordPress. * * @since 2.2.0 * @access private */ private function set_locale() { $plugin_i18n = new Smart_Post_Show_i18n(); $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); } /** * Register common hooks. * * @since 2.2.0 * @access private */ private function define_common_hooks() { $common_hooks = new Smart_Post_Show_Post_Type( SP_PC_PLUGIN_NAME, SP_PC_VERSION ); $this->loader->add_action( 'init', $common_hooks, 'register_carousel_post_type', 10 ); } /** * Register all of the hooks related to the admin area functionality * of the plugin. * * @since 2.2.0 * @access private */ private function define_admin_hooks() { $plugin_admin = new Smart_Post_Show_Admin( SP_PC_PLUGIN_NAME, SP_PC_VERSION ); // Load admin scripts and styles. $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); // Admin custom column. $this->loader->add_filter( 'manage_sp_post_carousel_posts_columns', $plugin_admin, 'filter_carousel_admin_column' ); $this->loader->add_filter( 'admin_footer_text', $plugin_admin, 'sp_spc_footer_text' ); $this->loader->add_filter( 'update_footer', $plugin_admin, 'sp_spc_version_text', 11 ); $this->loader->add_action( 'manage_sp_post_carousel_posts_custom_column', $plugin_admin, 'display_carousel_admin_fields', 10, 2 ); $this->loader->add_filter( 'plugin_row_meta', $plugin_admin, 'after_pcp_row_meta', 10, 4 ); // Post save and update messages. $this->loader->add_filter( 'post_updated_messages', $plugin_admin, 'sppcp_update', 10, 1 ); // Help Page. SPS_Recommended::instance(); $import_export = new Smart_Post_Show_Import_Export( SP_PC_PLUGIN_NAME, SP_PC_VERSION ); $this->loader->add_action( 'wp_ajax_pcp_export_shortcodes', $import_export, 'export_shortcodes' ); $this->loader->add_action( 'wp_ajax_pcp_import_shortcodes', $import_export, 'import_shortcodes' ); // after activated plugin redirect to help page. $this->loader->add_action( 'activated_plugin', $plugin_admin, 'redirect_help_page' ); } /** * Register all of the hooks related to the public-facing functionality * of the plugin. * * @since 2.2.0 * @access private */ private function define_public_hooks() { $plugin_public = new Smart_Post_Show_Public( SP_PC_PLUGIN_NAME, SP_PC_VERSION ); $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); $this->loader->add_action( 'wp_loaded', $plugin_public, 'register_all_scripts' ); } /** * Run the loader to execute all of the hooks with WordPress. * * @since 2.2.0 */ public function run() { $this->loader->run(); } /** * The name of the plugin used to uniquely identify it within the context of * WordPress and to define internationalization functionality. * * @since 2.2.0 * @return string The name of the plugin. */ public function get_plugin_name() { return $this->plugin_name; } /** * The reference to the class that orchestrates the hooks with the plugin. * * @since 2.2.0 * @return Smart_Post_Show_Loader Orchestrates the hooks of the plugin. */ public function get_loader() { return $this->loader; } /** * Retrieve the version number of the plugin. * * @since 2.2.0 * @return string The version number of the plugin. */ public function get_version() { return $this->version; } }