theme = wp_get_theme(); $this->slug = $this->theme->template; $this->pro_name = str_replace( ' Lite', '', $this->theme->name ); $this->lite_slug = $this->slug . '-lite'; $this->utm = '?utm_source=WordPress&utm_medium=link&utm_campaign=' . $this->slug; add_action( 'admin_menu', array( $this, 'add_menu' ) ); add_action( 'admin_notices', array( $this, 'notice' ) ); } /** * Add theme dashboard page. */ public function add_menu() { $page = add_theme_page( $this->theme->name, $this->theme->name, 'edit_theme_options', $this->slug, array( $this, 'render' ) ); add_action( "admin_print_styles-$page", array( $this, 'enqueue_scripts' ) ); } public function get_tabs() { $tabs = [ 'getting-started' => __( 'Getting Started', 'blogz' ), 'actions' => __( 'Actions', 'blogz' ), 'pro' => __( 'Free vs Pro', 'blogz' ), ]; return apply_filters( 'blogz_dashboard_tabs', $tabs ); } /** * Show dashboard page. */ public function render() { $tabs = $this->get_tabs(); ?>
welcome page.', 'blogz' ), $this->theme->name, esc_url( admin_url( 'themes.php?page=' . $this->slug ) ) ) ); ?>