_x( 'Design Lab Patterns', 'Block pattern category', 'abc-studio' ), 'description' => __ ( 'A collection of professionally designed patterns.', 'abc-studio'), ) ); register_block_pattern_category( 'abc_studio_page', array( 'label' => _x( 'Design Lab Page Layouts', 'Block pattern category', 'abc-studio' ), 'description' => __( 'A collection of full page layouts.', 'abc-studio' ), ) ); } add_action( 'init', 'abc_studio_register_block_patterns' ); /** * Register block styles. * * @package Abc Studio * @since 1.0.0 */ if ( function_exists( 'register_block_style' ) ) { function abc_studio_register_block_styles() { // Post Terms register_block_style( 'core/post-terms', array( 'name' => 'dl-pill-shape', 'label' => esc_html__( 'Pill shape', 'abc-studio' ), 'inline_style' => ' .wp-block-post-terms.is-style-dl-pill-shape a { display: inline-flex; position: relative; padding: 0.25em 1em; text-decoration: none; } .wp-block-post-terms.is-style-dl-pill-shape a:before { content: ""; background: var(--wp--preset--color--contrast); width: 100%; height: 100%; position: absolute; left: 0; top: 0; border-radius: 32px; opacity: 0.07; transition: opacity .25s ease; } .wp-block-post-terms.is-style-dl-pill-shape a:hover { opacity: 0.8; } .wp-block-post-terms.is-style-dl-pill-shape .wp-block-post-terms__separator { visibility: hidden; }', ) ); // Post Terms register_block_style( 'core/post-terms', array( 'name' => 'dl-outline-pill-shape', 'label' => esc_html__( 'Outline Pill shape', 'abc-studio' ), 'inline_style' => ' .wp-block-post-terms.is-style-dl-outline-pill-shape a { display: inline-flex; position: relative; padding: 0.25em 1em; text-decoration: none; border: 1px solid currentColor; border-radius: 32px; opacity: 1; transition: opacity .25s ease; } .wp-block-post-terms.is-style-dl-outline-pill-shape a:hover { opacity: .8; text-decoration: none; } .wp-block-post-terms.is-style-dl-outline-pill-shape .wp-block-post-terms__separator { visibility: hidden; }', ) ); // List register_block_style( 'core/list', array( 'name' => 'dl-check-list', 'label' => esc_html__( 'Check list', 'abc-studio' ), 'inline_style' => ' html { --dl-check-icon: url(\'data:image/svg+xml,\') } .is-style-dl-check-list { list-style-type: none; line-height: var(--wp--custom--typography--line-height--medium); padding: 0 0 0 1em; } .is-style-dl-check-list li { position: relative; padding-left: 2em; } .is-style-dl-check-list li:not(:first-child) { margin-top: 0.5em; } .is-style-dl-check-list li:before { content: " "; display: block; width: 24px; height: 24px; position: absolute; left: 0; top: 2px; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; background-color: currentColor; -webkit-mask-image: var(--dl-check-icon); mask-image: var(--dl-check-icon); }', ) ); register_block_style( 'core/list', array( 'name' => 'dl-arrow-list', 'label' => esc_html__( 'Arrow list', 'abc-studio' ), 'inline_style' => ' html { --dl-arrow-icon: url(\'data:image/svg+xml,\') } .is-style-dl-arrow-list { list-style-type: none; line-height: var(--wp--custom--typography--line-height--medium); padding: 0; } .is-style-dl-arrow-list li { position: relative; padding-left: 2.5em; } .is-style-dl-arrow-list li:not(:first-child) { margin-top: .5em; } .is-style-dl-arrow-list li:before { content: " "; display: block; width: 32px; height: 16px; position: absolute; left: 0; top: 8px; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; background-color: currentColor; -webkit-mask-image: var(--dl-arrow-icon); mask-image: var(--dl-arrow-icon); }', ) ); // Details register_block_style( 'core/details', array( 'name' => 'dl-plus-icon-details', 'label' => __( 'Plus icon', 'abc-studio' ), 'inline_style' => ' .is-style-dl-plus-icon-details { padding: var(--wp--preset--spacing--20); } .is-style-dl-plus-icon-details summary { outline: 0; list-style-type: "\002B\00a0\00a0"; } .is-style-dl-plus-icon-details[open] > summary { list-style-type: "\2212\00a0\00a0"; } .is-style-dl-plus-icon-details summary::marker { font-size: 1.5em; line-height: 1; }', ) ); } add_action( 'init', 'abc_studio_register_block_styles' ); } /** * Add About page class * @package Abc Studio * @since 1.0.0 */ require_once get_template_directory() . '/inc/about-page/class-about-page.php'; /** * Add About page instance * @package Abc Studio * @since 1.0.0 */ $theme = wp_get_theme(); if ( is_child_theme() ) { $theme_name = $theme->parent()->get( 'Name' ); $theme_slug = $theme->parent()->get_template(); } else { $theme_name = $theme->get( 'Name' ); $theme_slug = $theme->get_template(); } $config = array( // Theme Name 'theme_name' => $theme_name, // Theme Slug 'theme_slug' => $theme_slug, // Theme Version 'theme_version' => $theme->get( 'Version' ), // Premium Theme Name 'theme_pro_name' => sprintf( __( '%s Pro', 'abc-studio' ), $theme_name ), // Premium Theme slug 'theme_pro_slug' => sprintf( __( '%s-pro', 'abc-studio' ), $theme_slug ), // Menu Name 'menu_name' => sprintf( __( 'About %s', 'abc-studio' ), $theme_name ), // Page Name 'page_name' => sprintf( __( 'About %s', 'abc-studio' ), $theme_name ), // Page welcome title 'welcome_title' => sprintf( __( 'Welcome to %s!', 'abc-studio' ), $theme_name ), // Page welcome content 'welcome_content' => sprintf( __( 'You have successfully installed the %s WordPress theme.', 'abc-studio' ), $theme_name ), // Tabs 'tabs' => array( 'getting_started' => esc_html__( 'Getting Started', 'abc-studio' ), 'free_pro' => esc_html__( 'Free vs Pro', 'abc-studio' ), ), // utm tracking 'utm' => '?utm_source=WordPress&utm_medium=about_page&utm_campaign=' . $theme_slug . '_upsell', ); Abc_Studio_About_Page::init( $config ); /** * Add About page notice * @package Abc Studio * @since 1.0.0 */ function abc_studio_notice() { $user_id = get_current_user_id(); if ( ! get_user_meta( $user_id, 'abc_studio_notice_dismissed' ) ) { ?>