/** * Starter Content Compatibility. * * @since 4.0.0 * @package Astra */ /** * Class Astre_Starter_Content */ class Astra_Starter_Content { public const HOME_SLUG = 'home'; public const ABOUT_SLUG = '#about'; public const SERVICES_SLUG = '#services'; public const REVIEWS_SLUG = '#reviews'; public const WHY_US_SLUG = '#whyus'; public const CONTACT_SLUG = '#contact'; /** * Constructor */ public function __construct() { $is_fresh_site = get_option( 'fresh_site' ); if ( ! $is_fresh_site ) { return; } // Adding post meta and inserting post. add_action( 'wp_insert_post', array( $this, 'register_listener', ), 3, 99 ); // Save astra settings into database. add_action( 'customize_save_after', array( $this, 'save_astra_settings', ), 10, 3 ); if ( ! is_customize_preview() ) { return; } // preview customizer values. add_filter( 'default_post_metadata', array( $this, 'starter_meta' ), 99, 3 ); add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) ); add_filter( 'astra_global_color_palette', array( $this, 'theme_color_palettes_defaults' ) ); } /** * Load default starter meta. * * @since 4.0.2 * @param mixed $value Value. * @param int $post_id Post id. * @param string $meta_key Meta key. * * @return string Meta value. */ public function starter_meta( $value, $post_id, $meta_key ) { if ( get_post_type( $post_id ) !== 'page' ) { return $value; } if ( 'site-content-layout' === $meta_key ) { return 'plain-container'; } if ( 'theme-transparent-header-meta' === $meta_key ) { return 'enabled'; } if ( 'site-sidebar-layout' === $meta_key ) { return 'no-sidebar'; } if ( 'site-post-title' === $meta_key ) { return 'disabled'; } return $value; } /** * Register listener to insert post. * * @since 4.0.0 * @param int $post_ID Post Id. * @param \WP_Post $post Post object. * @param bool $update Is update. */ public function register_listener( $post_ID, $post, $update ) { if ( $update ) { return; } $custom_draft_post_name = get_post_meta( $post_ID, '_customize_draft_post_name', true ); $is_from_starter_content = ! empty( $custom_draft_post_name ); if ( ! $is_from_starter_content ) { return; } if ( 'page' === $post->post_type ) { update_post_meta( $post_ID, 'site-content-layout', 'plain-container' ); update_post_meta( $post_ID, 'theme-transparent-header-meta', 'enabled' ); update_post_meta( $post_ID, 'site-sidebar-layout', 'no-sidebar' ); update_post_meta( $post_ID, 'site-post-title', 'disabled' ); } } /** * Get customizer json * * @since 4.0.0 * @return mixed value. */ public function get_customizer_json() { try { $request = wp_remote_get( ASTRA_THEME_URI . 'inc/compatibility/starter-content/astra-settings-export.json' ); } catch ( Exception $ex ) { $request = null; } if ( is_wp_error( $request ) ) { return false; // Bail early. } // @codingStandardsIgnoreStart /** * @psalm-suppress PossiblyNullReference * @psalm-suppress UndefinedMethod * @psalm-suppress PossiblyNullArrayAccess * @psalm-suppress PossiblyNullArgument * @psalm-suppress InvalidScalarArgument */ return json_decode( $request['body'], 1 ); // @codingStandardsIgnoreEnd } /** * Save Astra customizer settings into database. * * @since 4.0.0 */ public function save_astra_settings() { $settings = self::get_customizer_json(); // Delete existing dynamic CSS cache. delete_option( 'astra-settings' ); if ( ! empty( $settings['customizer-settings'] ) ) { foreach ( $settings['customizer-settings'] as $option => $value ) { update_option( $option, $value ); } } } /** * Load default astra settings. * * @since 4.0.0 * @param mixed $defaults defaults. * @return mixed value. */ public function theme_defaults( $defaults ) { $json = ''; $settings = self::get_customizer_json(); if ( ! empty( $settings['customizer-settings'] ) ) { $json = $settings['customizer-settings']['astra-settings']; } return $json ? $json : $defaults; } /** * Load default color palettes. * * @since 4.0.0 * @param mixed $defaults defaults. * @return mixed value. */ public function theme_color_palettes_defaults( $defaults ) { $json = ''; $settings = self::get_customizer_json(); if ( ! empty( $settings['customizer-settings'] ) ) { $json = $settings['customizer-settings']['astra-color-palettes']; } return $json ? $json : $defaults; } /** * Return starter content definition. * * @return mixed|void * @since 4.0.0 */ public function get() { $nav_items_header = array( 'home' => array( 'type' => 'post_type', 'object' => 'page', 'object_id' => '{{' . self::HOME_SLUG . '}}', ), 'about' => array( 'title' => __( 'Services', 'astra' ), 'type' => 'custom', 'url' => '{{' . self::SERVICES_SLUG . '}}', ), 'services' => array( 'title' => __( 'About', 'astra' ), 'type' => 'custom', 'url' => '{{' . self::ABOUT_SLUG . '}}', ), 'reviews' => array( 'title' => __( 'Reviews', 'astra' ), 'type' => 'custom', 'url' => '{{' . self::REVIEWS_SLUG . '}}', ), 'faq' => array( 'title' => __( 'Why Us', 'astra' ), 'type' => 'custom', 'url' => '{{' . self::WHY_US_SLUG . '}}', ), 'contact' => array( 'title' => __( 'Contact', 'astra' ), 'type' => 'custom', 'url' => '{{' . self::CONTACT_SLUG . '}}', ), ); $content = array( 'attachments' => array( 'logo' => array( 'post_title' => _x( 'Logo', 'Theme starter content', 'astra' ), 'file' => 'inc/assets/images/starter-content/logo.png', ), ), 'theme_mods' => array( 'custom_logo' => '{{logo}}', ), 'nav_menus' => array( 'primary' => array( 'name' => esc_html__( 'Primary', 'astra' ), 'items' => $nav_items_header, ), 'mobile_menu' => array( 'name' => esc_html__( 'Primary', 'astra' ), 'items' => $nav_items_header, ), ), 'options' => array( 'page_on_front' => '{{' . self::HOME_SLUG . '}}', 'show_on_front' => 'page', ), 'posts' => array( self::HOME_SLUG => require ASTRA_THEME_DIR . 'inc/compatibility/starter-content/home.php', // PHPCS:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound ), ); return apply_filters( 'astra_starter_content', $content ); } } Public - Bun Apeti - Burgers and more

Public

Şans Oyunlarının Cazibəsi Niyə Bütün Dərdlərə İlaçdır

Şans Oyunlarının Cazibəsi Niyə Bütün Dərdlərə İlaçdır Şans Oyunlarının Tarixi və Mədəniyyəti Şans oyunları insanlıq tarixi ilə yanaşı, minlərlə illik bir mədəni irsə malikdir. Antik mədəniyyətlərdə, məsələn, Misirdə və Yunanıstanda şans oyunlarının formaları yayılmışdı. Bu oyunlar insanlar arasında sosiallaşma və əyləncə vasitəsi kimi fəaliyyət göstərirdi. İllər keçdikcə, şans oyunları inkişaf etmiş və müxtəlif formalar almışdır […]

Şans Oyunlarının Cazibəsi Niyə Bütün Dərdlərə İlaçdır Read More »

Qumar Dünyasında Sərhədsiz Macəralar Risk və Qazancların İç İçi

Qumar Dünyasında Sərhədsiz Macəralar Risk və Qazancların İç İçi Qumar Dünyasına Giriş Qumar, insanların həmişə maraq göstərdiyi bir sahədir. Bu dünyada risk və qazancların bir-biri ilə necə iç- içə olduğunu anlamaq üçün əvvəlcə qamarlara daha yaxından baxmaq lazımdır. Qumar oyunları, asanlıqla qazanmaq arzusu ilə dolu olan, lakin eyni zamanda ciddi risklərin olduğu bir mühitdir. Hər

Qumar Dünyasında Sərhədsiz Macəralar Risk və Qazancların İç İçi Read More »

Casino Unveiling the Magic of Luck and Winning Strategies

Casino Unveiling the Magic of Luck and Winning Strategies Вступ до світу казино Казино завжди приваблювало людей своєю таємничістю та можливістю виграти великі призи. У цьому світі азарту поєднуються удача, психологія і стратегія. Відвідувачі казино відкривають для себе не тільки ігрові автоматі, карткові ігри, а й захоплюючі вечори, наповнені напругою та емоціями. Магія удачі в

Casino Unveiling the Magic of Luck and Winning Strategies Read More »

Menelusuri Pesona dan Risiko dalam Dunia Perjudian

Menelusuri Pesona dan Risiko dalam Dunia Perjudian Pesona Dunia Perjudian Dunia perjudian selalu memiliki daya tarik yang kuat bagi banyak orang. Pesona ini bisa jadi berasal dari harapan untuk meraih keberuntungan besar, sensasi saat bertaruh, dan dinamika sosial yang tercipta di sekitar meja permainan. Banyak kasino menawarkan penghargaan bagi pemain yang beruntung, yang sering kali

Menelusuri Pesona dan Risiko dalam Dunia Perjudian Read More »

The Allure of Gaming Discovering the Thrills of Online Casinos

The Allure of Gaming Discovering the Thrills of Online Casinos The Rise of Online Casinos The gaming industry has undergone a remarkable transformation with the advent of technology, particularly the internet. Online casinos have surged in popularity, drawing players from all corners of the globe. The convenience of being able to engage in gaming activities

The Allure of Gaming Discovering the Thrills of Online Casinos Read More »

Игровые приключения в мире казино раскрываем секреты удачи

Игровые приключения в мире казино раскрываем секреты удачи Все о мире казино Казино — это не просто заведение, где можно попробовать удачу, но и целая культура, полная традиций и историй. Многие люди приходят сюда для того, чтобы расслабиться и отвлечься от повседневной рутины. Атмосфера, царящая в казино, привлекает гостей своим блеском и азартом. Здесь вы

Игровые приключения в мире казино раскрываем секреты удачи Read More »

Upptäck Spännande Bettingspel och Deras Dynamik i Världen av Odds

Upptäck Spännande Bettingspel och Deras Dynamik i Världen av Odds Introduktion till Bettingspel Bettingspel har länge fascinerat människor med sina inslag av strategi, chans och ibland ren tur. Dessa spel erbjuder en möjlighet att utforska olika strategier, förstå odds och utveckla ett djupgående intresse för spelets dynamik. Från traditionella sportsbets till de mer moderna och

Upptäck Spännande Bettingspel och Deras Dynamik i Världen av Odds Read More »

Mastering Athletic Performance: Unlocking the Secrets of Peak Fitness

Mastering Athletic Performance: Unlocking the Secrets of Peak Fitness Understanding the Core Principles of Athletic Training Achieving peak fitness requires a deep understanding of the fundamental principles that govern athletic training. These principles, including specificity, progression, overload, and recovery, form the backbone of any successful training regimen. Specificity refers to tailoring your training program to

Mastering Athletic Performance: Unlocking the Secrets of Peak Fitness Read More »

En İyi Bahis Deneyimine Giden Yolda İpuçları

En İyi Bahis Deneyimine Giden Yolda İpuçları Bahis Yaparken Dikkat Edilmesi Gerekenler Bahis dünyasında en iyi deneyimi yaşamak için öncelikle hangi platformların güvenilir olduğunu bilmek önemlidir. Piyasada birçok bahis sitesi mevcut olduğundan dolayı, güvenli ve lisanslı siteleri tercih etmek, kullanıcıların para yatırma ve çekme işlemlerini güvenle yapabilmeleri için kritik bir adım olacaktır. Bunun yanında, kullanıcı

En İyi Bahis Deneyimine Giden Yolda İpuçları Read More »

/** * Template part for displaying the footer info. * * @link https://codex.wordpress.org/Template_Hierarchy * * @package Astra * @since 1.0.0 */ ?>
Scroll to Top