setup_hooks(); } private function setup_hooks() { add_action('admin_menu', array($this, 'create_menu')); add_action('in_admin_header', array($this, 'hide_admin_notices')); } /** * Theme Url * * @access private * @var string $theme_url * @since 1.0.0 */ private $theme_url = 'https://wpinterface.com/themes/bloglex/'; /** * Documentation Url * * @access private * @var string $doc_url * @since 1.0.0 */ private $doc_url = 'https://docs.wpinterface.com/bloglex/'; /** * Preview Url * * @access private * @var string $preview_url * @since 1.0.0 */ private $preview_url = 'https://demo.wpinterface.com/bloglex'; /** * Misc Support Url * * @access private * @since 1.0.0 */ private $community_url = 'https://wordpress.org/support/theme/bloglex/'; private $support_url = 'https://wpinterface.com/support/'; private $facebook_url = 'https://www.facebook.com/wpinterface'; private $x_url = 'https://x.com/wp_interface'; private $youtube_url = 'https://www.youtube.com/@wpinterface'; public function create_menu() { if (!is_child_theme()) { $theme = wp_get_theme(); } else { $theme = wp_get_theme()->parent(); } /* translators: %s: Theme Name. */ $theme_page_name = sprintf(esc_html__('%s', 'bloglex'), $theme->Name); add_theme_page( $theme_page_name, $theme_page_name, 'edit_theme_options', 'bloglex', array( $this, 'dashboard_page', ) ); } /** * Hide admin notices from BlockArt admin pages. * * @since 1.0.0 */ public function hide_admin_notices() { // Bail if we're not on a Bloglex screen or page. if (empty($_REQUEST['page']) || false === strpos(sanitize_text_field(wp_unslash($_REQUEST['page'])), 'bloglex')) { // phpcs:ignore WordPress.Security.NonceVerification return; } global $wp_filter; $ignore_notices = apply_filters('bloglex_ignore_hide_admin_notices', array()); foreach (array('user_admin_notices', 'admin_notices', 'all_admin_notices') as $wp_notice) { if (empty($wp_filter[$wp_notice])) { continue; } $hook_callbacks = $wp_filter[$wp_notice]->callbacks; if (empty($hook_callbacks) || !is_array($hook_callbacks)) { continue; } foreach ($hook_callbacks as $priority => $hooks) { foreach ($hooks as $name => $callback) { if (!empty($name) && in_array($name, $ignore_notices, true)) { continue; } if ( !empty($callback['function']) && !is_a($callback['function'], '\Closure') && isset($callback['function'][0], $callback['function'][1]) && is_object($callback['function'][0]) && in_array($callback['function'][1], $ignore_notices, true) ) { continue; } unset($wp_filter[$wp_notice]->callbacks[$priority][$name]); } } } } public function dashboard_page() { if (!is_child_theme()) { $theme = wp_get_theme(); } else { $theme = wp_get_theme()->parent(); } $admin_url = admin_url(); $tabs = apply_filters( 'bloglex_dashboard_tabs', array( 'dashboard' => array( 'name' => esc_html__('Dashboard', 'bloglex'), 'callback' => function () { include __DIR__ . '/views/dashboard.php'; }, ), 'starter-templates' => array( 'name' => esc_html__('Starter Templates', 'bloglex'), 'callback' => function () { include __DIR__ . '/views/starter-templates.php'; }, ), 'products' => array( 'name' => esc_html__('Our Recommendation', 'bloglex'), 'callback' => function () { include __DIR__ . '/views/products.php'; }, ), 'free-vs-pro' => array( 'name' => esc_html__('Free Vs Pro', 'bloglex'), 'callback' => function () { include __DIR__ . '/views/free-vs-pro.php'; }, ), 'help' => array( 'name' => esc_html__('Help', 'bloglex'), 'callback' => function () { include __DIR__ . '/views/help.php'; }, ), ) ) ?>
' . esc_html($entry['date']) . '
'; echo '' . esc_html($change) . '
'; } echo 'No changelog data available.
'; } ?>