' . __( 'Get Started', STACKABLE_I18N ), // Menu title. 'manage_options', // Capability. 'stackable-getting-started', // Menu slug. array( $this, 'stackable_getting_started_content' ), // Callback function. null // Position ); } public function enqueue_dashboard_script( $hook ) { // For stackable pages, show our admin css. if ( 'settings_page_stackable' === $hook || stripos( $hook, 'page_stackable' ) !== false || stripos( $hook, 'page_stk' ) !== false ) { wp_enqueue_style( 'stackable-welcome', plugins_url( 'dist/admin_welcome.css', STACKABLE_FILE ), array() ); wp_enqueue_style( 'ugb-block-editor-css', plugins_url( 'dist/editor_blocks.css', STACKABLE_FILE ), array() ); do_action( 'stackable_settings_admin_enqueue_styles' ); } // For the options page, load our options script. if ( 'settings_page_stackable' === $hook || stripos( $hook, 'page_stackable-settings' ) !== false ) { wp_enqueue_script( 'wp-i18n' ); wp_enqueue_script( 'wp-element' ); wp_enqueue_script( 'wp-hooks' ); wp_enqueue_script( 'wp-util' ); // Need wp.ajax. wp_enqueue_script( 'wp-components' ); // Need Spinner. wp_enqueue_style( 'wp-components' ); // Need Spinner. do_action( 'stackable_settings_admin_enqueue_scripts' ); wp_enqueue_script( 'stackable-welcome', plugins_url( 'dist/admin_welcome.js', STACKABLE_FILE ), array( 'wp-i18n', 'wp-element', 'wp-hooks', 'wp-util', 'wp-components', 'wp-api', 'wp-editor' ) ); // Add translations. wp_set_script_translations( 'stackable-welcome', STACKABLE_I18N ); stackable_load_js_translations(); // This is needed for the translation strings to be loaded. $args = apply_filters( 'stackable_localize_settings_script', array( 'srcUrl' => untrailingslashit( plugins_url( '/', STACKABLE_FILE ) ), 'welcomeSrcUrl' => untrailingslashit( plugins_url( '/', __FILE__ ) ), 'i18n' => STACKABLE_I18N, 'cdnUrl' => STACKABLE_CLOUDFRONT_URL, 'isPro' => sugb_fs()->can_use_premium_code(), 'showProNotice' => stackable_should_show_pro_notices(), 'pricingURL' => sugb_fs()->get_upgrade_url(), 'contactURL' => ! sugb_fs()->is_whitelabeled() ? sugb_fs()->contact_url( 'technical_support' ) : '', 'planName' => sugb_fs()->get_plan_name(), 'showProNoticesOption' => STACKABLE_SHOW_PRO_NOTICES && ! sugb_fs()->can_use_premium_code(), 'nonceNews' => stackable_get_news_feed_nonce(), ) ); wp_localize_script( 'stackable-welcome', 'stackable', $args ); } } public static function print_tabs() { $screen = get_current_screen(); ?>
get_user() ) { ?> has_affiliate_program() ) { ?> is_whitelabeled() ) { ?> can_use_premium_code() ) { ?>

<?php esc_attr_e( 'Stackable', STACKABLE_I18N ) ?>

print_header( __( 'Stackable Settings', STACKABLE_I18N ) ) ?> print_tabs() ?>

can_use_premium_code() ) : ?>

', '' ) ?>

', '', '', '' ) ?>

can_use_premium_code() ) : ?>

', '' ) ?>

can_use_premium_code() ) : ?>

' . __( 'Learn more', STACKABLE_I18N ) . '' ?>

can_use_premium_code() ) : ?>

' . __( 'Learn more', STACKABLE_I18N ) . '' ?>

can_use_premium_code() ) : ?>

', '' ) ?>

can_use_premium_code() ) : ?>

', '' ) ?>

', '' ) ?>

can_use_premium_code() ) : ?>
print_header( '', 'logo' ) ?>
print_tabs() ?>

  • Block Type', STACKABLE_I18N )?>

  • Design Library', STACKABLE_I18N )?>

(+) icon then scroll to the Stackable Blocks area to add a block.', STACKABLE_I18N )?>

ready-made UI Kits & Block Designs.', STACKABLE_I18N ) ?>


Dynamic content and copy and paste buttons are only available in %sStackable Premium%s.', STACKABLE_I18N ), '', '' ) ?>

can_use_premium_code() ) { ?>

%s', admin_url( 'options-general.php?page=stackable' ), __( 'Settings', STACKABLE_I18N ) ); // Prevent warnings in PHP 7.0+ when a plugin uses this filter incorrectly. $links = (array) $links; array_unshift( $links, $settings_link ); } // Go Premium link. if ( ! sugb_fs()->is_whitelabeled() && ! sugb_fs()->can_use_premium_code() ) { $premium_link = sprintf( '%s', 'https://wpstackable.com/premium/?utm_source=wp-plugins&utm_campaign=gopremium&utm_medium=wp-dashboard', __( 'Go Premium', STACKABLE_I18N ) ); // Prevent warnings in PHP 7.0+ when a plugin uses this filter incorrectly. $links = (array) $links; $links[] = $premium_link; } return $links; } /** * Adds a marker to remember to redirect after activation. * Redirecting right away will not work. */ public static function start_redirect_to_welcome_page() { update_option( 'stackable_redirect_to_welcome', '1' ); } /** * Redirect to the welcome screen if our marker exists. */ public function redirect_to_welcome_page() { if ( ! sugb_fs()->is_activation_mode() && current_user_can( 'manage_options' ) && ( get_option( 'stackable_redirect_to_welcome' ) || get_option( 'stackable_redirected_to_wizard' ) === false ) ) { // Never go here again. delete_option( 'stackable_redirect_to_welcome' ); // If we haven't been to the wizard yet, go there. if ( get_option( 'stackable_redirected_to_wizard' ) === false ) { update_option( 'stackable_redirected_to_wizard', '1' ); wp_redirect( esc_url( admin_url( 'options-general.php?page=stackable-settings-wizard' ) ) ); // Or go to the getting started page. } else { wp_redirect( esc_url( admin_url( 'options-general.php?page=stackable-getting-started' ) ) ); } die(); } } } new Stackable_Welcome_Screen(); } // Redirect to the welcome screen. register_activation_hook( STACKABLE_FILE, array( 'Stackable_Welcome_Screen', 'start_redirect_to_welcome_page' ) );