esc_url( admin_url( 'themes.php?page=pt-one-click-demo-import' )), ) ); wp_localize_script( 'bizz-ecommerce-admin-load', 'THAdmin', $data); } else { wp_enqueue_style( 'texture-notify-css', get_template_directory_uri() . '/lib/texture-option/assets/css/notify.css' ); } } function tab_constant(){ $themedata = wp_get_theme(); $tab_array = array(); $tab_array['header'] = array('theme_brand' => __('wptexture','bizz-ecommerce'), 'theme_brand_url' => esc_url($themedata->get( 'AuthorURI' )), 'welcome'=>sprintf(esc_html__('Welcome To %1s Theme', 'bizz-ecommerce'), esc_html($themedata->get( 'Name' ),'bizz-ecommerce'), $themedata->get( 'Version' ) ), 'welcome_desc' => esc_html($themedata->get( 'Name' ).' is an eCommerce WordPress theme specially made for shopping websites.', 'bizz-ecommerce' ), 'v'=> 'Version '.$themedata->get( 'Version' ) ); return $tab_array; } function tab_page() { $text_array = $this->tab_constant(); $theme_header =$text_array['header']; include('tab-html.php' ); } // Home Page Setup function default_home() { $pages = get_pages(array( 'meta_key' => '_wp_page_template', 'meta_value' => 'frontpage.php' )); $post_id = isset($pages[0]->ID)?$pages[0]->ID:false; if(empty($pages)){ $post_id = wp_insert_post(array ( 'post_type' => 'page', 'post_title' => __('Home Page','bizz-ecommerce'), 'post_content' => '', 'post_status' => 'publish', 'comment_status' => 'closed', // if you prefer 'ping_status' => 'closed', // if you prefer 'page_template' =>'frontpage.php', //Sets the template for the page. )); } if($post_id){ update_option( 'page_on_front', $post_id ); update_option( 'show_on_front', 'page' ); } wp_die(); // this is required to terminate immediately and return a proper response } function _check_homepage_setup(){ $fid = get_option( 'page_on_front'); $pages = get_pages(array( 'meta_key' => '_wp_page_template', 'meta_value' => 'frontpage.php' )); $post_id = isset($pages[0]->ID)?$pages[0]->ID:false; return ($fid == $post_id)?true:false; } /* * Plugin install * Active plugin * Setup Homepage */ public function th_activeplugin(){ if ( ! current_user_can( 'install_plugins' ) || ! isset( $_POST['init'] ) || ! $_POST['init'] ) { wp_send_json_error( array( 'success' => false, 'message' => __( 'No plugin specified', 'bizz-ecommerce' ), ) ); } $plugin_init = ( isset( $_POST['init'] ) ) ? esc_attr( $_POST['init'] ) : ''; $activate = activate_plugin( $plugin_init); if ( is_wp_error( $activate ) ) { wp_send_json_error( array( 'success' => false, 'message' => $activate->get_error_message(), ) ); } wp_send_json_success( array( 'success' => true, 'message' => __( 'Plugin Successfully Activated', 'bizz-ecommerce' ), ) ); } function plugin_install_button($plugin){ $button = '