OwlCyberSecurity - MANAGER
Edit File: demodata.php
<?php // Do not allow directly accessing this file. if ( ! defined( 'ABSPATH' ) ) { exit( 'Direct script access denied.' ); } function la_goodheart_get_demo_array($dir_url, $dir_path){ $demo_items = array( '01-goodheart-charity' => array( 'link' => 'https://goodheart.la-studioweb.com/01-goodheart-charity/', 'title' => 'Charity & Fundraising', 'title2' => '01 GoodHeart Charity', 'data_elementor' => array( 'header' => array( 'location' => 'header', 'value' => array( 'goodheart-header-05' => 'include/general', ), ), 'footer' => array( 'location' => 'footer', 'value' => array( 'goodheart-footer-05' => 'include/general', ), ), ), 'category' => array( 0 => 'Demo', ), 'data_slider' => '', ), '02-goodheart-wildlife' => array( 'link' => 'https://goodheart.sva.la-studioweb.com/02-goodheart-wildlife/', 'title' => 'Wildlife Animals', 'title2' => '02 GoodHeart Wildlife', 'data_elementor' => array( 'header' => array( 'location' => 'header', 'value' => array( 'goodheart-header-02' => 'include/general', ), ), 'footer' => array( 'location' => 'footer', 'value' => array( 'goodheart-footer-02' => 'include/general', ), ), ), 'category' => array( 0 => 'Demo', ), 'data_slider' => '', ), '03-goodheart-humanitarian-crisis' => array( 'link' => 'https://goodheart.sva.la-studioweb.com/03-goodheart-humanitarian-crisis/', 'title' => 'Humanitarian Crisis', 'title2' => '03 GoodHeart Humanitarian Crisis', 'data_elementor' => array( 'header' => array( 'location' => 'header', 'value' => array( 'goodheart-header-03' => 'include/general', ), ), 'footer' => array( 'location' => 'footer', 'value' => array( 'goodheart-footer-03' => 'include/general', ), ), ), 'category' => array( 0 => 'Demo', ), 'data_slider' => '', ), '04-goodheart-cancer-fundraising' => array( 'link' => 'https://goodheart.sva.la-studioweb.com/04-goodheart-cancer-fundraising/', 'title' => 'Cancer Fundraising', 'title2' => '04 GoodHeart Cancer Fundraising', 'data_elementor' => array( 'header' => array( 'location' => 'header', 'value' => array( 'goodheart-header-04' => 'include/general', ), ), 'footer' => array( 'location' => 'footer', 'value' => array( 'goodheart-footer-04' => 'include/general', ), ), ), 'category' => array( 0 => 'Demo', ), 'data_slider' => '', ), '05-goodheart-save-the-pets' => array( 'link' => 'https://goodheart.sva.la-studioweb.com/05-goodheart-save-the-pets/', 'title' => 'Save the Pets', 'title2' => '05 GoodHeart Save the Pets', 'data_elementor' => array( 'header' => array( 'location' => 'header', 'value' => array( 'goodheart-header-06' => 'include/general', ), ), 'footer' => array( 'location' => 'footer', 'value' => array( 'goodheart-footer-06' => 'include/general', ), ), ), 'category' => array( 0 => 'Demo', ), 'data_slider' => '', ), '06-goodheart-save-the-children' => array( 'link' => 'https://goodheart.sva.la-studioweb.com/06-goodheart-save-the-children/', 'title' => 'Save the Children', 'title2' => '06 GoodHeart Save the Children', 'data_elementor' => array( 'header' => array( 'location' => 'header', 'value' => array( 'goodheart-header-01' => 'include/general', ), ), 'footer' => array( 'location' => 'footer', 'value' => array( 'goodheart-footer-01' => 'include/general', ), ), ), 'category' => array( 0 => 'Demo', ), 'data_slider' => '', ), ); $default_image_setting = array( 'woocommerce_single_image_width' => 600, 'woocommerce_thumbnail_image_width' => 600, 'woocommerce_thumbnail_cropping' => 'custom', 'woocommerce_thumbnail_cropping_custom_width' => 27, 'woocommerce_thumbnail_cropping_custom_height' => 37, 'thumbnail_size_w' => 0, 'thumbnail_size_h' => 0, 'medium_size_w' => 0, 'medium_size_h' => 0, 'medium_large_size_w' => 0, 'medium_large_size_h' => 0, 'large_size_w' => 0, 'large_size_h' => 0, ); $default_menu = array( 'main-nav' => 'GoodHeart Primary Menu' ); $default_page = array( 'page_for_posts' => 'GoodHeart Menu', 'woocommerce_shop_page_id' => 'Shop', 'woocommerce_cart_page_id' => 'Cart', 'woocommerce_checkout_page_id' => 'Checkout', 'woocommerce_myaccount_page_id' => 'My Account' ); $slider = $dir_path . 'Slider/'; $content = $dir_path . 'Content/'; $product = $dir_path . 'Product/'; $widget = $dir_path . 'Widget/'; $setting = $dir_path . 'Setting/'; $preview = $dir_url; $default_elementor = [ 'single-post' => [ 'location' => 'single', 'value' => [ 'goodheart-single-post-01' => 'include/singular/post', 'goodheart-single-event' => 'include/singular/la_event', 'goodheart-single-project-01' => 'include/singular/la_portfolio', 'goodheart-single-donation' => 'include/singular/give_forms', ], ], 'single-page' => [ 'location' => 'single', 'value' => '', 'default' => [ 'goodheart-woopages' => [ 'include/singular/page/wishlist', 'include/singular/page/compare', 'include/singular/page/cart', 'include/singular/page/checkout' ], ] ], 'archive' => [ 'location' => 'archive', 'value' => [ 'goodheart-blog-sidebar' => 'include/archive', 'goodheart-event-grid' => [ 'include/archive/la_event_archive', 'include/archive/la_event_type', ], 'goodheart-donation-02-columns' => [ 'include/archive/give_forms_archive', 'include/archive/give_forms_category', 'include/archive/give_forms_tag', ], 'goodheart-project-03-columns' => [ 'include/archive/la_portfolio_archive', 'include/archive/la_portfolio_category' ], ] ], 'search-results' => [ 'location' => 'archive', 'value' => '', 'default' => [ 'goodheart-search' => 'include/archive/search' ], ], 'error-404' => [ 'location' => 'single', 'value' => '', 'default' => [ 'goodheart-404' => 'include/singular/not_found404' ], ], 'product' => [ 'location' => 'single', 'value' => '', 'default' => [ 'goodheart-single-product-01' => 'include/product' ] ], 'product-archive' => [ 'location' => 'archive', 'value' => '', 'default' => [ 'goodheart-shop-sidebar' => 'include/product_archive' ] ], ]; $elementor_kit_settings = json_decode( file_get_contents( $setting . 'settings.json' ), true ); $data_return = array(); foreach ($demo_items as $demo_key => $demo_detail){ $value = array(); $value['title'] = $demo_detail['title']; $value['category'] = !empty($demo_detail['category']) ? $demo_detail['category'] : array('Demo'); $value['demo_preset'] = $demo_key; $value['demo_url'] = $demo_detail['link']; $value['preview'] = !empty($demo_detail['preview']) ? $demo_detail['preview'] : ($preview . $demo_key . '.jpg'); $value['option'] = $setting . 'theme-settings.json'; $value['content'] = !empty($demo_detail['data_sample']) ? $content . $demo_detail['data_sample'] : $content . 'demo-data.json'; $value['product'] = !empty($demo_detail['data_product']) ? $product . $demo_detail['data_product'] : $product . 'products.csv'; $value['widget'] = !empty($demo_detail['data_widget']) ? $widget . $demo_detail['data_widget'] : $widget . 'widgets.json'; $value['pages'] = array_merge( $default_page, array( 'page_on_front' => $demo_detail['title2'] )); $value['menu-locations'] = array_merge( $default_menu, isset($demo_detail['menu-locations']) ? $demo_detail['menu-locations'] : array()); $value['other_setting'] = array_merge( $default_image_setting, isset($demo_detail['other_setting']) ? $demo_detail['other_setting'] : array()); if(!empty($demo_detail['data_slider'])){ $value['slider'] = $slider . $demo_detail['data_slider']; } $value['elementor'] = array_merge( $default_elementor, isset($demo_detail['data_elementor']) ? $demo_detail['data_elementor'] : array()); $value['elementor_kit_settings'] = array_merge( $elementor_kit_settings, isset($demo_detail['elementor_kit_settings']) ? $demo_detail['elementor_kit_settings'] : array()); $data_return[$demo_key] = $value; } return $data_return; }