Current File : /home/bravrvjk/cepurhuye.rw/wp-content/plugins/bopea-function/inc/function//init.php
<?php
if ( !defined( 'ABSPATH' ) ) exit;
if ( ! is_admin() ) {
return;
}
if ( !class_exists( 'Radium_Theme_Demo_Data_Importer' ) ) {
require_once( plugin_dir_path( __FILE__ ) . 'importer/radium-importer.php' );
class Radium_Theme_Demo_Data_Importer extends Radium_Theme_Importer {
public $theme_options_framework = 'customizer';
private static $instance;
public $theme_option_name = 'JELLYWP_PANEL';
public $theme_options_file_name = 'theme_options.dat';
public $widgets_file_name = 'widgets.json';
public $content_demo_file_name = 'content.xml';
public $widget_import_results;
public function __construct() {
if(!isset($_GET['import_theme_demo'])) {
$_GET['import_theme_demo'] = 0;
}
$this->demo_files_path = plugin_dir_path( __FILE__ ) . 'demo-files/'.$_GET['import_theme_demo'].'/';
self::$instance = $this;
parent::__construct();
}
public function set_demo_menus(){
if ( is_admin() ) {
if(isset($_GET["page"]) && $_GET["page"] == 'radium_demo_installer'){
$top_menu = get_term_by('slug', 'top-menu', 'nav_menu');
$main_menu = get_term_by('slug', 'main-menu', 'nav_menu');
$mobile_menu = get_term_by('slug', 'mobile-menu', 'nav_menu');
$footer_menu = get_term_by('slug', 'footer', 'nav_menu');
// Default demo
set_theme_mod( 'nav_menu_locations', array(
'top_menu' => $top_menu->term_id,
'main_menu' => $main_menu->term_id,
'mobile_menu' => $main_menu->term_id,
'footer_menu' => $footer_menu->term_id
)
);
$front_page = get_page_by_title( "Home" );
update_option( 'page_on_front', $front_page->ID );
update_option( 'show_on_front', 'page' );
$checkout_page = get_page_by_title( "Checkout" );
update_option( 'woocommerce_checkout_page_id', $checkout_page->ID );
$cart_page = get_page_by_title( "Cart" );
update_option( 'woocommerce_cart_page_id', $cart_page->ID );
$shop_page = get_page_by_title( "Shop" );
update_option( 'woocommerce_shop_page_id', $shop_page->ID );
$account_page = get_page_by_title( "My Account" );
update_option( 'woocommerce_myaccount_page_id', $account_page->ID );
if($_GET['import_theme_demo'] == 1) {
$term_cat = get_terms('category');
if ($term_cat) {
$i = 0;
foreach( $term_cat as $tag) {
$term_id = $tag->term_id;
if($i == 0){
update_term_meta( $term_id, 'jelly_header_id', 22867 );
update_term_meta( $term_id, 'category_color_options', '#64a51d' );
}
if($i == 1){
update_term_meta( $term_id, 'jelly_header_id', 22866 );
update_term_meta( $term_id, 'category_color_options', '#ff2905' );
}
if($i == 2){
update_term_meta( $term_id, 'jelly_header_id', 22864 );
update_term_meta( $term_id, 'category_color_options', '#d3bb00' );
}
if($i == 3){
update_term_meta( $term_id, 'jelly_header_id', 22862 );
update_term_meta( $term_id, 'category_color_options', '#006ff6' );
}
if($i == 4){
update_term_meta( $term_id, 'jelly_header_id', 22865 );
update_term_meta( $term_id, 'category_color_options', '#1da5ba' );
}
if($i == 5){
update_term_meta( $term_id, 'jelly_header_id', 22863 );
update_term_meta( $term_id, 'category_color_options', '#8224e3' );
}
$i++;
}
}
}
if($_GET['import_theme_demo'] == 2) {
$term_cat = get_terms('category');
if ($term_cat) {
$i = 0;
foreach( $term_cat as $tag) {
$term_id = $tag->term_id;
if($i == 0){
update_term_meta( $term_id, 'jelly_header_id', 22055 );
update_term_meta( $term_id, 'category_color_options', '#64a51d' );
}
if($i == 1){
update_term_meta( $term_id, 'jelly_header_id', 22054 );
update_term_meta( $term_id, 'category_color_options', '#ff2905' );
}
if($i == 2){
update_term_meta( $term_id, 'jelly_header_id', 22056 );
update_term_meta( $term_id, 'category_color_options', '#d3bb00' );
}
if($i == 3){
update_term_meta( $term_id, 'jelly_header_id', 22053 );
update_term_meta( $term_id, 'category_color_options', '#006ff6' );
}
if($i == 4){
update_term_meta( $term_id, 'jelly_header_id', 22052 );
update_term_meta( $term_id, 'category_color_options', '#1da5ba' );
}
if($i == 5){
update_term_meta( $term_id, 'jelly_header_id', 22051 );
update_term_meta( $term_id, 'category_color_options', '#8224e3' );
}
$i++;
}
}
}
if($_GET['import_theme_demo'] == 3) {
$term_cat = get_terms('category');
if ($term_cat) {
$i = 0;
foreach( $term_cat as $tag) {
$term_id = $tag->term_id;
if($i == 0){
update_term_meta( $term_id, 'category_color_options', '#00ab4a' );
}
if($i == 1){
update_term_meta( $term_id, 'category_color_options', '#f22717' );
}
if($i == 2){
update_term_meta( $term_id, 'category_color_options', '#f526d6' );
}
if($i == 3){
update_term_meta( $term_id, 'category_color_options', '#ff5722' );
}
if($i == 4){
update_term_meta( $term_id, 'category_color_options', '#5800ab' );
}
if($i == 5){
update_term_meta( $term_id, 'category_color_options', '#0272f0' );
}
$i++;
}
}
}
if($_GET['import_theme_demo'] == 4) {
$term_cat = get_terms('category');
if ($term_cat) {
$i = 0;
foreach( $term_cat as $tag) {
$term_id = $tag->term_id;
if($i == 0){
update_term_meta( $term_id, 'category_color_options', '#00ab4a' );
}
if($i == 1){
update_term_meta( $term_id, 'category_color_options', '#f22717' );
}
if($i == 2){
update_term_meta( $term_id, 'category_color_options', '#f526d6' );
}
if($i == 3){
update_term_meta( $term_id, 'category_color_options', '#ff5722' );
}
if($i == 4){
update_term_meta( $term_id, 'category_color_options', '#5800ab' );
}
if($i == 5){
update_term_meta( $term_id, 'category_color_options', '#0272f0' );
}
$i++;
}
}
}
if($_GET['import_theme_demo'] == 5) {
$term_cat = get_terms('category');
if ($term_cat) {
$i = 0;
foreach( $term_cat as $tag) {
$term_id = $tag->term_id;
if($i == 0){
update_term_meta( $term_id, 'category_color_options', '#64a51d' );
}
if($i == 1){
update_term_meta( $term_id, 'category_color_options', '#ff2905' );
}
if($i == 2){
update_term_meta( $term_id, 'category_color_options', '#f22d3a' );
}
if($i == 3){
update_term_meta( $term_id, 'category_color_options', '#1da5ba' );
}
if($i == 4){
update_term_meta( $term_id, 'category_color_options', '#d3bb00' );
}
if($i == 5){
update_term_meta( $term_id, 'category_color_options', '#006ff6' );
}
$i++;
}
}
}
if($_GET['import_theme_demo'] == 6) {
$term_cat = get_terms('category');
if ($term_cat) {
$i = 0;
foreach( $term_cat as $tag) {
$term_id = $tag->term_id;
if($i == 0){
update_term_meta( $term_id, 'category_color_options', '#ff00be' );
}
if($i == 1){
update_term_meta( $term_id, 'category_color_options', '#00d7d4' );
}
if($i == 2){
update_term_meta( $term_id, 'category_color_options', '#006ff6' );
}
if($i == 3){
update_term_meta( $term_id, 'category_color_options', '#ff2905' );
}
if($i == 4){
update_term_meta( $term_id, 'category_color_options', '#8cba1d' );
}
if($i == 5){
update_term_meta( $term_id, 'category_color_options', '#0272f0' );
}
$i++;
}
}
}
if($_GET['import_theme_demo'] == 7) {
$term_cat = get_terms('category');
if ($term_cat) {
$i = 0;
foreach( $term_cat as $tag) {
$term_id = $tag->term_id;
if($i == 0){
update_term_meta( $term_id, 'jelly_header_id', 24451 );
update_term_meta( $term_id, 'category_color_options', '#00ab4a' );
}
if($i == 1){
update_term_meta( $term_id, 'jelly_header_id', 24452 );
update_term_meta( $term_id, 'category_color_options', '#eab308' );
}
if($i == 2){
update_term_meta( $term_id, 'jelly_header_id', 24448 );
update_term_meta( $term_id, 'category_color_options', '#eab308' );
}
if($i == 3){
update_term_meta( $term_id, 'jelly_header_id', 24449 );
update_term_meta( $term_id, 'category_color_options', '#ec4899' );
}
if($i == 4){
update_term_meta( $term_id, 'jelly_header_id', 24450 );
update_term_meta( $term_id, 'category_color_options', '#ef4444' );
}
if($i == 5){
update_term_meta( $term_id, 'jelly_header_id', 24447 );
update_term_meta( $term_id, 'category_color_options', '#635bff' );
}
$i++;
}
}
}
$this->flag_as_imported['menus'] = true;
}
}
}
}
new Radium_Theme_Demo_Data_Importer;
}