prepare_class(); /*admin menu*/ add_action( 'admin_menu', array( $this, 'at_admin_menu' ) ); /* enqueue script and style for about page */ add_action( 'admin_enqueue_scripts', array( $this, 'style_and_scripts' ) ); /* ajax callback for dismissable required actions */ add_action( 'wp_ajax_at_theme_info_update_recommended_action', array( $this, 'update_recommended_action_callback' ) ); } /** * Get the config array. */ public function get_config() { return array( // Page title. 'page_title' => esc_html__( 'Beauty Studio Info', 'beauty-studio' ), // Menu name under Appearance. 'menu_title' => esc_html__( 'Beauty Studio Info', 'beauty-studio' ), // Main welcome title 'info_title' => sprintf( esc_html__( 'Welcome to %s - ', 'beauty-studio' ), 'Beauty Studio' ), // Main welcome content 'info_content' => sprintf( esc_html__( '%s is now installed and ready to use. We hope the following information will help you. If you want to ask any query or just want to say hello, you can always contact us. We hope you enjoy it! ', 'beauty-studio' ), 'Beauty Studio' ), /** * Quick links */ 'quick_links' => array( 'theme_url' => array( 'text' => __( 'Theme Details', 'beauty-studio' ), 'url' => 'https://www.acmethemes.com/themes/beauty-studio/', ), 'demo_url' => array( 'text' => __( 'View Demo', 'beauty-studio' ), 'url' => 'http://www.demo.acmethemes.com/beauty-studio/', ), 'pro_url' => array( 'text' => __( 'View Pro Version', 'beauty-studio' ), 'url' => 'https://www.acmethemes.com/themes/beauty-studio-pro/', ), 'rate_url' => array( 'text' => __( 'Rate This Theme', 'beauty-studio' ), 'url' => 'https://wordpress.org/support/theme/beauty-studio/reviews/?filter=5', ), ), /** * Tabs array. *'tabs' => array( 'getting_started' => __( 'Getting Started', 'beauty-studio' ), 'recommended_actions' => __( 'Recommended Actions', 'beauty-studio' ), 'recommended_plugins' => __( 'Useful Plugins','beauty-studio' ), 'support' => __( 'Support', 'beauty-studio' ), 'changelog' => __( 'Changelog', 'beauty-studio' ), 'faq' => __( 'FAQ', 'beauty-studio' ), 'free_pro' => __( 'Free VS PRO', 'beauty-studio' ), ), * The key needs to be ONLY consisted from letters and underscores. If we want to define outside the class a function to render the tab, * the will be the name of the function which will be used to render the tab content. */ 'tabs' => array( 'getting_started' => esc_html__( 'Getting Started', 'beauty-studio' ), 'recommended_actions' => esc_html__( 'Recommended Actions', 'beauty-studio' ), 'recommended_plugins' => esc_html__( 'Useful Plugins', 'beauty-studio' ), 'support' => esc_html__( 'Support', 'beauty-studio' ), 'changelog' => esc_html__( 'Changelog', 'beauty-studio' ), 'faq' => esc_html__( 'FAQ', 'beauty-studio' ), 'free_pro' => esc_html__( 'Free VS PRO', 'beauty-studio' ), ), /*Getting started tab*/ 'getting_started' => array( 'first' => array( 'title' => esc_html__( 'Step 1 : Read full documentation', 'beauty-studio' ), 'desc' => esc_html__( 'Please check our full documentation for detailed information on how to Setup and Use Beauty Studio.', 'beauty-studio' ), 'link_title' => esc_html__( 'Documentation', 'beauty-studio' ), 'link_url' => 'http://www.doc.acmethemes.com/beauty-studio/', 'is_button' => false, 'recommended_actions' => false, 'is_new_tab' => true, ), 'second' => array( 'title' => esc_html__( 'Step 2 : Go to Customizer', 'beauty-studio' ), 'desc' => esc_html__( 'All Setting, Theme Options, Widgets and Menus are available via Customize screen. Have a quick look or start customization!', 'beauty-studio' ), 'link_title' => esc_html__( 'Go to Customizer', 'beauty-studio' ), 'link_url' => esc_url( admin_url( 'customize.php' ) ), 'is_button' => true, 'recommended_actions' => false, 'is_new_tab' => true, ), 'third' => array( 'title' => esc_html__( 'Step 3: Setting Static Front Page', 'beauty-studio' ), 'desc' => esc_html__( 'Select A static page than Front page and Posts page to enable Slider and Home Main Content Area', 'beauty-studio' ), 'link_title' => esc_html__( 'Static Front Page', 'beauty-studio' ), 'link_url' => esc_url( admin_url( 'customize.php' ) ) . '?autofocus[section]=static_front_page', 'is_button' => true, 'recommended_actions' => false, 'is_new_tab' => true, ), 'forth' => array( 'title' => esc_html__( 'Step 4 : Setting Featured Section ', 'beauty-studio' ), 'desc' => esc_html__( 'Advanced Feature Section is available in this theme. You can add Feature Main Slider and Feature Right Vertical Slider, also you can add widgets before feature. Please do the Step 3 before this.', 'beauty-studio' ), 'link_title' => esc_html__( 'Featured Section', 'beauty-studio' ), 'link_url' => esc_url( admin_url( 'customize.php' ) ) . '?autofocus[panel]=beauty-studio-feature-panel', 'is_button' => true, 'recommended_actions' => false, 'is_new_tab' => true, ), 'fifth' => array( 'title' => esc_html__( 'Step 5 : Setting Home Main Content Area ', 'beauty-studio' ), 'desc' => esc_html__( 'You can Add, Edit, Remove or Drag, Drop, Reorder widgets on Home Main Content Area. Please do the Step 3 before this.', 'beauty-studio' ), 'link_title' => esc_html__( 'Home Main Content Area', 'beauty-studio' ), 'link_url' => esc_url( admin_url( 'customize.php' ) ) . '?autofocus[section]=sidebar-widgets-beauty-studio-home', 'is_button' => true, 'recommended_actions' => false, 'is_new_tab' => true, ), 'sixth' => array( 'title' => esc_html__( 'Do not forget to install WooCommerce', 'beauty-studio' ), 'desc' => esc_html__( 'If you are using this theme for your online store or shop, do not forget to install WooCommerce Plugin', 'beauty-studio' ), 'link_title' => esc_html__( 'Install Recommended Plugins', 'beauty-studio' ), 'link_url' => '?page=beauty-studio-info&tab=recommended_plugins', 'is_button' => true, 'recommended_actions' => false, 'is_new_tab' => false, ), ), // recommended actions array. 'recommended_actions' => array( 'demo-content' => array( 'title' => esc_html__( 'Install Demo Setup', 'beauty-studio' ), 'desc' => sprintf( esc_html__( 'For the demo content installation, install the Acme Demo Setup plugin and other Recommended plugins, download demo content from %1$s here %2$s. Then go to "Acme Demo Setup" and import demo. ', 'beauty-studio' ), '', '' ), 'id' => 'acme-demo-setup', 'check' => ( ( function_exists( 'acme_demo_setup_load_textdomain' ) ) ? true : false ), 'plugin_slug' => 'acme-demo-setup', ), 'front-page' => array( 'title' => esc_html__( 'Setting Static Front Page', 'beauty-studio' ), 'desc' => sprintf( esc_html__( 'Select A static page than Front page and Posts page to enable Slider and Home Main Content Area %1$s Static Front Page %2$s ', 'beauty-studio' ), '
' ), 'id' => 'front-page', 'check' => ( ( 'page' == get_option( 'show_on_front' ) ) ? true : false ), ), ), // Plugins array. 'recommended_plugins' => array( 'gutentor' => array( 'slug' => 'gutentor', ), 'woocommerce' => array( 'slug' => 'woocommerce', ), 'yith-woocommerce-wishlist' => array( 'slug' => 'yith-woocommerce-wishlist', ), ), /*FAQ*/ 'faq' => array( 'first' => array( 'title' => esc_html__( 'How to Setup Site like Demo', 'beauty-studio' ), 'icon' => 'dashicons dashicons-sos', 'desc' => sprintf( esc_html__( 'For the demo content installation, install the Acme Demo Setup plugin and other Recommended plugins, download demo content from %1$s here %2$s. Then go to "Acme Demo Setup" and import demo. ', 'beauty-studio' ), '', '' ), 'button_label' => esc_html__( 'Download Demo Content', 'beauty-studio' ), 'button_link' => esc_url( 'http://www.doc.acmethemes.com/beauty-studio/#DummyData' ), 'is_button' => true, 'is_new_tab' => true, ), 'second' => array( 'title' => esc_html__( 'Feature Section is now Showing', 'beauty-studio' ), 'icon' => 'dashicons dashicons-sos', 'desc' => esc_html__( 'Please go to Setting => Reading,then Select A static page than Front page and Posts page to enable Slider and Home Main Content Area', 'beauty-studio' ), 'button_label' => esc_html__( 'Set Static Page', 'beauty-studio' ), 'button_link' => esc_url( admin_url( 'options-reading.php' ) ), 'is_button' => true, 'is_new_tab' => true, ), 'third' => array( 'title' => esc_html__( 'Hide Beauty Studio by Acme Themes from footer ? ', 'beauty-studio' ), 'icon' => 'dashicons dashicons-sos', 'desc' => esc_html__( 'Please visit the blog post to know more about it.', 'beauty-studio' ), 'button_label' => esc_html__( 'Hide credit text on Footer', 'beauty-studio' ), 'button_link' => esc_url( 'https://www.acmethemes.com/blog/2017/01/remove-powered-by-text-on-footer/' ), 'is_button' => true, 'is_new_tab' => true, ), 'forth' => array( 'title' => esc_html__( 'Recent Updates of your Site ? ', 'beauty-studio' ), 'icon' => 'dashicons dashicons-sos', 'desc' => esc_html__( 'Where i can get the recent updates of theme related updates ? ', 'beauty-studio' ), 'button_label' => esc_html__( 'Visit our site blog page', 'beauty-studio' ), 'button_link' => esc_url( 'https://www.acmethemes.com/blog/' ), 'is_button' => true, 'is_new_tab' => true, ), ), // Support content tab. 'support_content' => array( 'first' => array( 'title' => esc_html__( 'Contact Support', 'beauty-studio' ), 'icon' => 'dashicons dashicons-sos', 'desc' => esc_html__( 'Got theme support question or found bug? Best place to ask your query is our dedicated Support forum.', 'beauty-studio' ), 'button_label' => esc_html__( 'Contact Support', 'beauty-studio' ), 'button_link' => esc_url( 'https://www.acmethemes.com/supports/forum/beauty-studio/' ), 'is_button' => true, 'is_new_tab' => true, ), 'second' => array( 'title' => esc_html__( 'Documentation', 'beauty-studio' ), 'icon' => 'dashicons dashicons-book-alt', 'desc' => esc_html__( 'Please check our full documentation for detailed information on how to Setup and Use Beauty Studio.', 'beauty-studio' ), 'button_label' => esc_html__( 'Read full documentation', 'beauty-studio' ), 'button_link' => 'http://www.doc.acmethemes.com/beauty-studio/', 'is_button' => false, 'is_new_tab' => true, ), 'third' => array( 'title' => esc_html__( 'Need more features?', 'beauty-studio' ), 'icon' => 'dashicons dashicons-screenoptions', 'desc' => esc_html__( 'Upgrade to PRO version for more exciting features and Priority Support.', 'beauty-studio' ), 'button_label' => esc_html__( 'View Pro Version', 'beauty-studio' ), 'button_link' => 'https://www.acmethemes.com/themes/beauty-studio-pro/', 'is_button' => true, 'is_new_tab' => true, ), 'fourth' => array( 'title' => esc_html__( 'Got sales related question?', 'beauty-studio' ), 'icon' => 'dashicons dashicons-cart', 'desc' => esc_html__( 'Have any query before purchase, you are more than welcome to ask.', 'beauty-studio' ), 'button_label' => esc_html__( 'Pre-sale Question?', 'beauty-studio' ), 'button_link' => 'https://www.acmethemes.com/pre-sale-question/', 'is_button' => true, 'is_new_tab' => true, ), 'fifth' => array( 'title' => esc_html__( 'Customization Request', 'beauty-studio' ), 'icon' => 'dashicons dashicons-hammer', 'desc' => esc_html__( 'Needed any customization for the theme, you can request from here.', 'beauty-studio' ), 'button_label' => esc_html__( 'Customization Request', 'beauty-studio' ), 'button_link' => 'https://www.acmethemes.com/customization-request/', 'is_button' => false, 'is_new_tab' => true, ), ), // Free vs pro array. 'free_pro' => array( array( 'title' => esc_html__( 'Custom Widgets', 'beauty-studio' ), 'desc' => esc_html__( 'All added custom widgets are ready for page builder plugin', 'beauty-studio' ), 'free' => esc_html__( '9+ Available', 'beauty-studio' ), 'pro' => esc_html__( '16+ Available', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Pricing Plans', 'beauty-studio' ), 'desc' => esc_html__( 'Pricing Plans Widgets', 'beauty-studio' ), 'free' => 'no', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Gallery Filter', 'beauty-studio' ), 'desc' => esc_html__( 'Galley/Portfolio filter ', 'beauty-studio' ), 'free' => 'no', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Google Map', 'beauty-studio' ), 'desc' => esc_html__( 'Map with advanced options', 'beauty-studio' ), 'free' => 'no', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Advanced WooCommerce Widget', 'beauty-studio' ), 'free' => 'no', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Widget Options', 'beauty-studio' ), 'desc' => esc_html__( 'Every widgets have multiple options to customize section', 'beauty-studio' ), 'free' => esc_html__( 'Limited', 'beauty-studio' ), 'pro' => esc_html__( 'Multiple Advanced Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Google Fonts', 'beauty-studio' ), 'desc' => esc_html__( 'Google fonts options for changing the overall site fonts ', 'beauty-studio' ), 'free' => 'yes', 'pro' => esc_html__( 'Unlimited +', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Color Options', 'beauty-studio' ), 'desc' => esc_html__( 'Color options for changing overall site colors, Contat us', 'beauty-studio' ), 'free' => esc_html__( 'Limited', 'beauty-studio' ), 'pro' => esc_html__( 'Almost All parts', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Header Options', 'beauty-studio' ), 'desc' => esc_html__( 'Customize the header section as your need.', 'beauty-studio' ), 'free' => esc_html__( 'Limited', 'beauty-studio' ), 'pro' => esc_html__( 'Multiple Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Breaking News Options', 'beauty-studio' ), 'desc' => esc_html__( 'Manage your breaking news section on header', 'beauty-studio' ), 'free' => 'yes', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Menu Options', 'beauty-studio' ), 'desc' => esc_html__( 'Lots of menu options are available to manage the menu section. Appearance > Menus', 'beauty-studio' ), 'free' => esc_html__( 'Limited', 'beauty-studio' ), 'pro' => esc_html__( 'Multiple Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Featured Selection', 'beauty-studio' ), 'desc' => esc_html__( 'This is slider section. Check every options there', 'beauty-studio' ), 'free' => esc_html__( 'Unlimited Page', 'beauty-studio' ), 'pro' => esc_html__( 'Unlimited Page, Custom or Third Party', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Featured Section Options', 'beauty-studio' ), 'desc' => esc_html__( 'Options to manage the sliders', 'beauty-studio' ), 'free' => esc_html__( 'Limited', 'beauty-studio' ), 'pro' => esc_html__( 'Multiple Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Sticky Sidebar', 'beauty-studio' ), 'desc' => esc_html__( 'Enable/Disable sticky sidebars', 'beauty-studio' ), 'free' => 'no', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Blog/Archive Options', 'beauty-studio' ), 'desc' => esc_html__( 'Various Options are available for the blog and archive page management. Check on Appearance > Customize > Layout/Design Options.', 'beauty-studio' ), 'free' => esc_html__( 'Limited', 'beauty-studio' ), 'pro' => esc_html__( 'Manage Almost Every Entity', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Footer Options', 'beauty-studio' ), 'desc' => esc_html__( 'Manage the every entity related to footer section.', 'beauty-studio' ), 'free' => esc_html__( 'Limited', 'beauty-studio' ), 'pro' => esc_html__( 'Multiple Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Social Options', 'beauty-studio' ), 'desc' => esc_html__( 'Options to manage the social icons like facebook, instagram, linkedin etc.', 'beauty-studio' ), 'free' => 'yes', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Theme Credit Link', 'beauty-studio' ), 'desc' => esc_html__( 'Options to disable to Powered by text on footer.', 'beauty-studio' ), 'free' => esc_html__( 'No Options To Disable', 'beauty-studio' ), 'pro' => esc_html__( 'Enable/Disable', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Own Credit Link', 'beauty-studio' ), 'desc' => esc_html__( 'Write your own credit text.', 'beauty-studio' ), 'free' => 'no', 'pro' => esc_html__( 'Enable/Disable', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Social Icons', 'beauty-studio' ), 'desc' => esc_html__( 'Enter the URL for social icons. ', 'beauty-studio' ), 'free' => esc_html__( 'Unlimited with multiple Options', 'beauty-studio' ), 'pro' => esc_html__( 'Unlimited with multiple Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Intro Loader Options', 'beauty-studio' ), 'desc' => esc_html__( 'It will load before the site loaded completely.', 'beauty-studio' ), 'free' => 'no', 'pro' => esc_html__( 'Multiple Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Related Post Options', 'beauty-studio' ), 'desc' => esc_html__( 'Related post will appear on single post of each blog article', 'beauty-studio' ), 'free' => 'no', 'pro' => esc_html__( 'Multiple Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Author Info Options', 'beauty-studio' ), 'desc' => esc_html__( 'This will appear on single post.', 'beauty-studio' ), 'free' => 'no', 'pro' => esc_html__( 'Multiple Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Feature Image Options', 'beauty-studio' ), 'desc' => esc_html__( 'Featured image options for the single page and post.', 'beauty-studio' ), 'free' => 'no', 'pro' => esc_html__( 'Manage As Your Need', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Navigation Options', 'beauty-studio' ), 'desc' => esc_html__( 'Post Navigation means, previous post and next post. Check on single post.', 'beauty-studio' ), 'free' => esc_html__( 'Default', 'beauty-studio' ), 'pro' => esc_html__( 'Advanced', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Post Comment Options', 'beauty-studio' ), 'desc' => esc_html__( 'Manage the comment section on single post.', 'beauty-studio' ), 'free' => 'no', 'pro' => esc_html__( 'Multiple Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Show/Hide Comment', 'beauty-studio' ), 'desc' => esc_html__( 'Options to show hide comments on page and post.', 'beauty-studio' ), 'free' => 'no', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Breadcrumb', 'beauty-studio' ), 'desc' => esc_html__( 'Advanced options for manage the Breadcrumb.', 'beauty-studio' ), 'free' => 'yes', 'pro' => esc_html__( 'Advanced', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Video Post On Featured', 'beauty-studio' ), 'desc' => esc_html__( 'Create your video post easily from Youtube and Vimeo video.', 'beauty-studio' ), 'free' => 'no', 'pro' => esc_html__( 'Add Own Video On Featured', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Single Post Options', 'beauty-studio' ), 'desc' => esc_html__( 'Manage every entity of single post.', 'beauty-studio' ), 'free' => esc_html__( 'Limited', 'beauty-studio' ), 'pro' => esc_html__( 'Multiple Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Featured Image Size', 'beauty-studio' ), 'desc' => esc_html__( 'Select the size of the featured image on the single post.', 'beauty-studio' ), 'free' => 'yes', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Sidebars', 'beauty-studio' ), 'desc' => esc_html__( 'Global and Individual sidebars are available. You can easily orveride it from single page/post.', 'beauty-studio' ), 'free' => esc_html__( 'Advanced Global And Individuals', 'beauty-studio' ), 'pro' => esc_html__( 'Advanced Global And Individuals', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Menu and Logo Location', 'beauty-studio' ), 'desc' => esc_html__( 'Position of menu and logo section on header.', 'beauty-studio' ), 'free' => esc_html__( 'Default', 'beauty-studio' ), 'pro' => esc_html__( '3 Position Left, Right and Middle', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Popup Widget on Header', 'beauty-studio' ), 'desc' => esc_html__( 'Options to popup widget via Popup Widget Area on Header Top Section.', 'beauty-studio' ), 'free' => esc_html__( 'Add your required Widget', 'beauty-studio' ), 'pro' => esc_html__( 'Add your required Widget', 'beauty-studio' ), ), array( 'title' => esc_html__( 'Multiple Header Type', 'beauty-studio' ), 'desc' => esc_html__( 'Different Types of Header.', 'beauty-studio' ), 'free' => esc_html__( 'Default', 'beauty-studio' ), 'pro' => esc_html__( '3 Options', 'beauty-studio' ), ), array( 'title' => esc_html__( 'WooCommerce', 'beauty-studio' ), 'desc' => esc_html__( 'Create WooCommerce shop easily with the help of WooCommerce plugin.', 'beauty-studio' ), 'free' => 'yes', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Translation', 'beauty-studio' ), 'desc' => esc_html__( 'Both theme are translation ready.', 'beauty-studio' ), 'free' => 'yes', 'pro' => 'yes', ), array( 'title' => esc_html__( 'SEO', 'beauty-studio' ), 'desc' => esc_html__( 'Developed with high skilled SEO tools.', 'beauty-studio' ), 'free' => 'yes', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Widget Area On Footer', 'beauty-studio' ), 'desc' => esc_html__( 'Change the number of footers on footer area as you need.', 'beauty-studio' ), 'free' => 'yes', 'pro' => 'yes', ), array( 'title' => esc_html__( 'Support Forum', 'beauty-studio' ), 'desc' => esc_html__( 'Highly dedicated support team are assigned for your help. Try this today.', 'beauty-studio' ), 'free' => esc_html__( 'Second', 'beauty-studio' ), 'pro' => esc_html__( 'Dedicated With High Priority', 'beauty-studio' ), ), ), ); } /** * Prepare and setup class properties. */ public function prepare_class() { $theme = wp_get_theme(); if ( is_child_theme() ) { $this->theme_name = esc_attr( $theme->parent()->get( 'Name' ) ); } else { $this->theme_name = esc_attr( $theme->get( 'Name' ) ); } $this->theme_slug = esc_attr( $theme->get_template() ); $this->theme_version = esc_attr( $theme->get( 'Version' ) ); } /** * Return the valid array of recommended actions. * * @return array The valid array of recommended actions. */ /** * Dismiss required actions */ public function update_recommended_action_callback() { $this->config = $this->get_config(); /*getting for provided array*/ $recommended_actions = isset( $this->config['recommended_actions'] ) ? $this->config['recommended_actions'] : array(); /*from js action*/ $action_id = esc_attr( ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0 ); $todo = esc_attr( ( isset( $_GET['todo'] ) ) ? $_GET['todo'] : '' ); /*getting saved actions*/ $saved_actions = get_option( $this->theme_slug . '_recommended_actions' ); echo esc_html( wp_unslash( $action_id ) ); /* this is needed and it's the id of the dismissable required action */ if ( ! empty( $action_id ) ) { if ( 'reset' == $todo ) { $saved_actions_new = array(); if ( ! empty( $recommended_actions ) ) { foreach ( $recommended_actions as $recommended_action ) { $saved_actions[ $recommended_action['id'] ] = true; } update_option( $this->theme_slug . '_recommended_actions', $saved_actions_new ); } } /* if the option exists, update the record for the specified id */ elseif ( ! empty( $saved_actions ) and is_array( $saved_actions ) ) { switch ( esc_html( $todo ) ) { case 'add'; $saved_actions[ $action_id ] = true; break; case 'dismiss'; $saved_actions[ $action_id ] = false; break; } update_option( $this->theme_slug . '_recommended_actions', $saved_actions ); /* create the new option,with false for the specified id */ } else { $saved_actions_new = array(); if ( ! empty( $recommended_actions ) ) { foreach ( $recommended_actions as $recommended_action ) { echo esc_attr( $recommended_action['id'] ); echo ' ' . esc_attr( $todo ); if ( $recommended_action['id'] == $action_id ) { switch ( esc_html( $todo ) ) { case 'add'; $saved_actions_new[ $action_id ] = true; break; case 'dismiss'; $saved_actions_new[ $action_id ] = false; break; } } } } update_option( $this->theme_slug . '_recommended_actions', $saved_actions_new ); } } exit; } private function get_recommended_actions() { $saved_actions = get_option( $this->theme_slug . '_recommended_actions' ); if ( ! is_array( $saved_actions ) ) { $saved_actions = array(); } $this->config = $this->get_config(); $recommended_actions = isset( $this->config['recommended_actions'] ) ? $this->config['recommended_actions'] : array(); $valid = array(); if ( isset( $recommended_actions ) && is_array( $recommended_actions ) ) { foreach ( $recommended_actions as $recommended_action ) { if ( ( ! isset( $recommended_action['check'] ) || ( isset( $recommended_action['check'] ) && ( $recommended_action['check'] == false ) ) ) && ( ! isset( $saved_actions[ $recommended_action['id'] ] ) || ( isset( $saved_actions[ $recommended_action['id'] ] ) && ( $saved_actions[ $recommended_action['id'] ] == true ) ) ) ) { $valid[] = $recommended_action; } } } return $valid; } private function count_recommended_actions() { $count = 0; $actions_count = $this->get_recommended_actions(); if ( ! empty( $actions_count ) ) { $count = count( $actions_count ); } return $count; } /** * Adding Theme Info Menu under Appearance. */ function at_admin_menu() { $this->config = $this->get_config(); $this->page_title = isset( $this->config['page_title'] ) ? $this->config['page_title'] : esc_html__( 'Info', 'beauty-studio' ) . $this->theme_name; $this->menu_title = isset( $this->config['menu_title'] ) ? $this->config['menu_title'] : esc_html__( 'Info', 'beauty-studio' ) . $this->theme_name; if ( ! empty( $this->page_title ) && ! empty( $this->menu_title ) ) { $count = $this->count_recommended_actions(); $menu_title = $count > 0 ? esc_html( $this->menu_title ) . '' . esc_html( $count ) . '' : esc_html( $this->menu_title ); /* Example * add_theme_page('My Plugin Theme', 'My Plugin', 'edit_theme_options', 'my-unique-identifier', 'my_plugin_function'); * */ add_theme_page( $this->page_title, $menu_title, 'edit_theme_options', $this->theme_slug . '-info', array( $this, 'at_theme_info_screen', ) ); } } /** * Render the info content screen. */ public function at_theme_info_screen() { $this->config = $this->get_config(); $this->tabs = isset( $this->config['tabs'] ) ? $this->config['tabs'] : array(); if ( ! empty( $this->config['info_title'] ) ) { $welcome_title = $this->config['info_title']; } if ( ! empty( $this->config['info_content'] ) ) { $welcome_content = $this->config['info_content']; } if ( ! empty( $this->config['quick_links'] ) ) { $quick_links = $this->config['quick_links']; } if ( ! empty( $welcome_title ) || ! empty( $welcome_content ) || ! empty( $quick_links ) || ! empty( $this->tabs ) ) { echo ''; foreach ( $quick_links as $quick_key => $quick_link ) { $button = 'button-secondary'; if ( 'pro_url' == $quick_key ) { $button = 'button-primary'; } echo '' . esc_html( $quick_link['text'] ) . ''; } echo '
'; } /* Display tabs */ if ( ! empty( $this->tabs ) ) { $current_tab = isset( $_GET['tab'] ) ? wp_unslash( $_GET['tab'] ) : 'getting_started'; echo '' . $desc . '
'; } if ( ! empty( $link_title ) && ! empty( $link_url ) ) { echo ''; $button_class = ''; if ( $is_button ) { $button_class = 'button button-primary'; } $count = $this->count_recommended_actions(); if ( $getting_started_item['recommended_actions'] && isset( $count ) ) { if ( $count == 0 ) { echo ''; } else { echo ''; } } $button_new_tab = '_self'; if ( $is_new_tab ) { $button_new_tab = '_blank'; } echo '' . esc_attr( $getting_started_item['link_title'] ) . ''; echo '
'; } echo '' . wp_kses_post( $desc ) . '
'; } if ( ! empty( $plugin_slug ) ) { $active = $this->check_plugin_status( $action_value['plugin_slug'] ); $url = $this->create_action_link( $active['needs'], $action_value['plugin_slug'] ); $label = ''; $class = ''; switch ( $active['needs'] ) { case 'install': $class = 'install-now button'; $label = esc_html__( 'Install', 'beauty-studio' ); break; case 'activate': $class = 'activate-now button button-primary'; $label = esc_html__( 'Activate', 'beauty-studio' ); break; case 'deactivate': $class = 'deactivate-now button'; $label = esc_html__( 'Deactivate', 'beauty-studio' ); break; } ?> '; $hooray = false; } } if ( $hooray ) { echo '' . esc_html__( 'Hooray! There are no recommended actions for you right now.', 'beauty-studio' ) . ''; echo '' . esc_html__( 'Show All Recommended Actions', 'beauty-studio' ) . ''; } echo '' . $desc . '
'; } if ( ! empty( $button_link ) && ! empty( $button_label ) ) { echo ''; $button_class = ''; if ( $is_button ) { $button_class = 'button button-primary'; } $button_new_tab = '_self'; if ( isset( $is_new_tab ) ) { if ( $is_new_tab ) { $button_new_tab = '_blank'; } } echo '' . $button_label . ''; echo '
'; } echo '"; echo wp_kses_post( $changelog ); echo ''; echo '
| '; echo ' | ' . esc_html__( 'Beauty Studio', 'beauty-studio' ) . ' | '; echo '' . esc_html__( 'Beauty Studio Pro', 'beauty-studio' ) . ' | '; echo '||||
|---|---|---|---|---|---|---|
';
if ( ! empty( $title ) ) {
echo '' . wp_kses_post( $title ) . ''; } if ( ! empty( $desc ) ) { echo '' . wp_kses_post( $desc ) . ' '; } echo ' | ';
}
if ( ! empty( $free ) ) {
if ( 'yes' === $free ) {
echo ''; } elseif ( 'no' === $free ) { echo ' | '; } else { echo ' | ' . esc_html( $free ) . ' | '; } } if ( ! empty( $pro ) ) { if ( 'yes' === $pro ) { echo ''; } elseif ( 'no' === $pro ) { echo ' | '; } else { echo ' | ' . esc_html( $pro ) . ' | '; } } echo '
| '; echo ' | Beauty Studio Pro | '; echo '|||||
' . $desc . '
'; } if ( ! empty( $button_link ) && ! empty( $button_label ) ) { echo ''; $button_class = ''; if ( $is_button ) { $button_class = 'button button-primary'; } $button_new_tab = '_self'; if ( isset( $is_new_tab ) ) { if ( $is_new_tab ) { $button_new_tab = '_blank'; } } echo '' . $button_label . ''; echo '
'; } echo '