$item ) { if ( isset( $item[2] ) && $item[2] === 'adaire-blocks-welcome' ) { $welcome_item = $item; $welcome_key = $key; break; } } if ( $welcome_item === null ) { return; } unset( $submenu[ $parent ][ $welcome_key ] ); array_unshift( $submenu[ $parent ], $welcome_item ); } public static function create_starter_page() { check_ajax_referer( 'adaire_create_page', 'nonce' ); if ( ! current_user_can( 'edit_pages' ) ) { wp_send_json_error( array( 'message' => __( 'Insufficient permissions.', 'adaire-blocks' ) ) ); } $pattern_slug = sanitize_text_field( wp_unslash( $_POST['pattern'] ?? 'adaire-blocks/landing-page' ) ); $registry = WP_Block_Patterns_Registry::get_instance(); $pattern = $registry->get_registered( $pattern_slug ); if ( ! $pattern ) { wp_send_json_error( array( 'message' => __( 'Pattern not found.', 'adaire-blocks' ) ) ); } $page_id = wp_insert_post( array( 'post_type' => 'page', 'post_status' => 'draft', 'post_title' => $pattern['title'], 'post_content' => $pattern['content'], ), true ); if ( is_wp_error( $page_id ) || empty( $page_id ) ) { $message = is_wp_error( $page_id ) ? $page_id->get_error_message() : __( 'Failed to create page.', 'adaire-blocks' ); wp_send_json_error( array( 'message' => $message ) ); } $edit_url = get_edit_post_link( $page_id, 'raw' ); if ( empty( $edit_url ) ) { wp_send_json_error( array( 'message' => __( 'Page created but could not get edit URL.', 'adaire-blocks' ) ) ); } wp_send_json_success( array( 'edit_url' => $edit_url ) ); } /** * Inline SVG icon set for this screen. Each icon uses a 24x24 viewBox * and a single `currentColor` stroke; size and colour are set by the * wrapping element's CSS (`color` + `width`/`height`). */ private static function icon( $name ) { $icons = array( 'sparkle' => '', 'plus' => '', 'rocket' => '', 'users' => '', 'settings' => '', 'file-text' => '', 'mail' => '', 'layout-top' => '', 'layout-bottom' => '', 'grid' => '', 'book-open' => '', 'blocks' => '', 'message-circle' => '', 'check-circle' => '', 'info' => '', 'chevron-left' => '', 'chevron-right' => '', 'brand-mark' => '', 'sync' => '', 'arrow-left' => '', 'external-link' => '', ); return isset( $icons[ $name ] ) ? $icons[ $name ] : ''; } public static function render() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'Unauthorized', 'adaire-blocks' ) ); } $nonce = wp_create_nonce( 'adaire_create_page' ); $ajax_url = admin_url( 'admin-ajax.php' ); $docs_url = 'https://adaire.digital/docs/'; $support_url = 'https://adaire.digital/support/'; $is_block_theme = function_exists( 'wp_is_block_theme' ) && wp_is_block_theme(); $theme_name = wp_get_theme()->get( 'Name' ); $theme_slug = get_stylesheet(); $header_url = admin_url( 'site-editor.php?postType=wp_template_part&postId=' . rawurlencode( $theme_slug . '//header' ) ); $footer_url = admin_url( 'site-editor.php?postType=wp_template_part&postId=' . rawurlencode( $theme_slug . '//footer' ) ); $all_parts_url = admin_url( 'site-editor.php?path=%2Fwp_template_part%2Fall' ); // Sidebar / quick-action destinations. $settings_url = admin_url( 'admin.php?page=adaire-blocks-settings' ); $migration_url = admin_url( 'admin.php?page=adaire-blocks-migration' ); $themes_url = admin_url( 'themes.php' ); $exit_url = admin_url(); // Bundled screenshots used as the hero visual. $hero_image_url = plugins_url( 'images/welcome-hero.png', __FILE__ ); $showcase_image_url = plugins_url( 'images/welcome-showcase.png', __FILE__ ); // Reference imagery for the template gallery and resource cards. // External preview assets; replace with self-hosted screenshots // before a production build. $preview_images = array( 'landing' => 'https://s3-figma-hubfile-images-production.figma.com/hub/file/carousel/img/99645573e15e412a5bbde37b293767e199538427', 'about' => 'https://elements-resized.envatousercontent.com/elements-cover-images/78d6a416-f0fa-4bef-803c-5409f46e8292?w=433&cf_fit=scale-down&q=85&format=auto&s=361f8685cc0bd6a084e3bf83cb1da9bed7d8ccbb8e6a657c8dfe4e420dc2efee', 'services' => 'https://marketstorage.b-cdn.net/users/rQMICWgf9EOBfrmE4CyLbdj4iiEgeWxc/previews/e22e1216-ce7b-475f-9c17-7143589e4f48/Dribbble-shot-HD-8.png', 'blog' => 'https://firmbee.com/wp-content/uploads/Mockup.webdesign2-1-900x856.png', ); $templates = array( array( 'slug' => 'adaire-blocks/landing-page', 'icon' => 'rocket', 'title' => __( 'Landing Page', 'adaire-blocks' ), 'description' => __( 'Hero, features, testimonial & CTA.', 'adaire-blocks' ), 'homepage' => true, 'image' => $preview_images['landing'], ), array( 'slug' => 'adaire-blocks/about-page', 'icon' => 'users', 'title' => __( 'About Page', 'adaire-blocks' ), 'description' => __( 'Hero, about section, timeline & testimonial.', 'adaire-blocks' ), 'homepage' => false, 'image' => $preview_images['about'], ), array( 'slug' => 'adaire-blocks/services-page', 'icon' => 'settings', 'title' => __( 'Services Page', 'adaire-blocks' ), 'description' => __( 'Hero, info grid & pricing table.', 'adaire-blocks' ), 'homepage' => false, 'image' => $preview_images['services'], ), array( 'slug' => 'adaire-blocks/blog-landing', 'icon' => 'file-text', 'title' => __( 'Blog Landing', 'adaire-blocks' ), 'description' => __( 'Hero with a posts grid.', 'adaire-blocks' ), 'homepage' => false, 'image' => $preview_images['blog'], ), array( 'slug' => 'adaire-blocks/contact-page', 'icon' => 'mail', 'title' => __( 'Contact Page', 'adaire-blocks' ), 'description' => __( 'Hero with a two-column contact layout.', 'adaire-blocks' ), 'homepage' => false, 'image' => '', ), ); $resources = array( array( 'href' => $docs_url . 'getting-started/', 'tag' => __( 'Guide', 'adaire-blocks' ), 'title' => __( 'Getting Started Guide', 'adaire-blocks' ), 'desc' => __( 'Step-by-step walkthrough of every block and setting.', 'adaire-blocks' ), 'cta' => __( 'Read the guide', 'adaire-blocks' ), 'image' => $preview_images['blog'], ), array( 'href' => $docs_url . 'blocks/', 'tag' => __( 'Reference', 'adaire-blocks' ), 'title' => __( 'Block Reference', 'adaire-blocks' ), 'desc' => __( 'Attributes, options, and examples for all free blocks.', 'adaire-blocks' ), 'cta' => __( 'Browse reference', 'adaire-blocks' ), 'image' => $preview_images['landing'], ), array( 'href' => $support_url, 'tag' => __( 'Help', 'adaire-blocks' ), 'title' => __( 'Support', 'adaire-blocks' ), 'desc' => __( 'Submit a ticket or browse answered questions.', 'adaire-blocks' ), 'cta' => __( 'Get support', 'adaire-blocks' ), 'image' => $preview_images['services'], ), ); ?>

Guten-Blocks

v ·
<?php esc_attr_e( 'A Guten-Blocks block in the WordPress editor', 'adaire-blocks' ); ?>
<?php esc_attr_e( 'Another Guten-Blocks block layout', 'adaire-blocks' ); ?>
1

2

3

$tpl ) : ?>
<?php echo esc_attr( $tpl['title'] ); ?>

' . esc_html( $theme_name ) . '' ); ?>

$res ) : ?>

__( 'How do I set a starter page as my homepage?', 'adaire-blocks' ), 'a' => __( 'Create the Landing Page template, publish it, then go to Settings → Reading and set it as your static front page.', 'adaire-blocks' ), ), array( 'q' => __( 'Can I edit the templates after they\'re created?', 'adaire-blocks' ), 'a' => __( 'Yes. Every template is just regular Adaire blocks on a draft page. Open it in the editor and replace any text, image, or section.', 'adaire-blocks' ), ), array( 'q' => __( 'What\'s the difference between the free and paid blocks?', 'adaire-blocks' ), 'a' => __( 'The free plan includes a curated set of layout, hero, and content blocks. Visit Guten-Blocks Settings to see which blocks are included and what upgrading unlocks.', 'adaire-blocks' ), ), array( 'q' => __( 'Why doesn\'t my theme show header/footer editing?', 'adaire-blocks' ), 'a' => __( 'Header and footer editing via the Site Editor only works with block themes. Classic themes manage these areas through their own theme settings or widgets.', 'adaire-blocks' ), ), ); ?>
$faq ) : ?>