// load backend asset. BackendAsset::getInstance(); SocialAccounts::getInstance(); } else { // Front End. // Frontend Ajax. FrontendAjax::getInstance(); // load google analytics. // load frontend asset. FrontendAsset::getInstance(); // Comment Number. CommentNumber::getInstance(); // Google Captcha. Captcha::getInstance(); } // Load Widget. $this->load_widget(); $this->populate_metabox(); } /** * Method load_helper * * @return void */ public function load_helper() { defined( 'JNEWS_THEME_DIR_PLUGIN' ) || define( 'JNEWS_THEME_DIR_PLUGIN', JNEWS_THEME_DIR . 'plugins/' ); defined( 'JNEWS_THEME_SERVER' ) || define( 'JNEWS_THEME_SERVER', 'https://jnews.io/' ); defined( 'JEGTHEME_SERVER' ) || define( 'JEGTHEME_SERVER', 'https://support.jegtheme.com/' ); // Load Plugin Helper. require_once get_parent_theme_file_path( 'lib/theme-helper.php' ); require_once get_parent_theme_file_path( 'lib/theme-filter.php' ); // Load class helper if there's no essential. if ( defined( 'JNEWS_ESSENTIAL' ) ) { $this->essential_script(); } else { require_once get_parent_theme_file_path( 'lib/class-helper.php' ); } } /** * Method load_textdomain * * @return void */ public function load_textdomain() { load_theme_textdomain( 'jnews', get_parent_theme_file_path( 'languages' ) ); } /** * Method load_module * * @return void */ public function load_module() { ModuleManager::getInstance(); if ( defined( 'WPB_VC_VERSION' ) ) { ModuleVC::getInstance(); } if ( defined( 'ELEMENTOR_VERSION' ) ) { ModuleElementor::getInstance(); } } /** * Method load_widget * * @return void */ public function load_widget() { Widget::getInstance(); WidgetTitle::getInstance(); if ( apply_filters( 'jnews_load_all_widget', false ) ) { $this->load_widget_element(); } } /** * Method load_widget_element * * @return void */ public function load_widget_element() { global $pagenow; EditWidgetArea::getInstance(); AdditionalWidget::getInstance(); if ( 'widgets.php' === $pagenow || 'post.php' === $pagenow || 'admin-ajax.php' === $pagenow || is_customize_preview() || ! is_admin() || apply_filters( 'jnews_load_register_widget', false ) ) { RegisterNormalWidget::getInstance(); RegisterModuleWidget::getInstance(); } } /** * Method load_admin_style * * @return void */ public function load_admin_style() { add_editor_style( get_parent_theme_file_uri( 'assets/css/admin/editor.css' ) ); if ( is_rtl() ) { add_editor_style( get_parent_theme_file_uri( 'assets/css/admin/editor-rtl.css' ) ); } } /** * Method multilang * * @return void */ public function multilang() { if ( class_exists( 'Polylang' ) ) { // multilanguage. Polylang::getInstance(); } if ( defined( 'ICL_SITEPRESS_VERSION' ) ) { // WPML multilanguage. WPML::getInstance(); } } /** * Method migrate_panel * * @param string $panel $panel. * * @return string */ public function migrate_panel( $panel ) { return 'jnews_global_panel'; } /** * Method populate_metabox * * @return void */ public function populate_metabox() { new Metabox(); } /** * Method plugin_update_notice * * @return void */ public function plugin_update_notice() { if ( is_admin() ) { $plugins = \JNews\Util\Api\Plugin::get_plugin_list(); echo jnews_sanitize_by_pass( $this->print_plugin_update_notice( $plugins ) ); } } /** * Method plugin_update_notice_text * * @param array $plugin $plugin. * @param string $action $action. * * @return string */ public function plugin_update_notice_text( $plugin, $action ) { $link = apply_filters( 'jnews_plugin_action_url', $plugin['slug'], $action ); // phpcs:disable WordPress.WP.I18n.UnorderedPlaceholdersText $html = '
' . sprintf( esc_html__( '%s Requires %s', 'jnews' ), $plugin['name'], ucfirst( $action ) ) . ' ' . sprintf( __( 'Please %s %s plugin to version %s or higher.', 'jnews' ), $action, $plugin['name'], '9.0.0' ) . '