0 ) { $theme = wp_get_theme(); ?>

Welcome page', 'business-a' ), $theme->Name, admin_url( 'themes.php?page=wd_themepage' ) ); ?>

'wd_themepage&tab=demo-data-importer' ), admin_url( 'themes.php' ) ) ).'">'.esc_html__( 'Import Demo Data', 'business-a' ).'' ); ?>

esc_html__( 'Activating ', 'business-a' ), ) ); wp_localize_script( 'business-a-plugin-install-helper', 'pagenow', array( 'import' ) ); } } public function business_a_about(){ $recommended_actions = $this->business_a_get_recommended_actions(); $number_count = $recommended_actions['number_notice']; if ( $number_count > 0 ){ $update_label = sprintf( _n( '%1$s action required', '%1$s actions required', $number_count, 'business-a' ), $number_count ); $count = "" . number_format_i18n($number_count) . ""; $menu_title = sprintf( esc_html__('Business A %s', 'business-a'), $count ); } else { $menu_title = esc_html__('Business A Theme', 'business-a'); } add_theme_page( esc_html__( 'Business A Dashboard', 'business-a' ), $menu_title, 'edit_theme_options', 'wd_themepage', array($this,'business_a_theme_about_page') ); } public function business_a_theme_about_page(){ $theme = wp_get_theme('business-a'); if ( isset( $_GET['business_a_action_dismiss'] ) ) { $actions_dismiss = get_option( 'business_a_actions_dismiss' ); if ( ! is_array( $actions_dismiss ) ) { $actions_dismiss = array(); } $actions_dismiss[ sanitize_text_field( $_GET['business_a_action_dismiss'] ) ] = 'dismiss'; update_option( 'business_a_actions_dismiss', $actions_dismiss ); } $tab = null; if ( isset( $_GET['tab'] ) ) { $tab = sanitize_text_field( $_GET['tab'] ); } else { $tab = null; } $actions_r = $this->business_a_get_recommended_actions(); $number_action = $actions_r['number_notice']; $actions = $actions_r['actions']; $current_action_link = admin_url( 'themes.php?page=wd_themepage&tab=recommended_actions' ); $recommend_plugins = get_theme_support( 'recommend-plugins' ); if ( is_array( $recommend_plugins ) && isset( $recommend_plugins[0] ) ){ $recommend_plugins = $recommend_plugins[0]; } else { $recommend_plugins[] = array(); } ?>

Version ); ?>

Webdzier
Business A Theme Screen
0 ) { ?> '', 'page_template' ) ); ?>

business_a_render_recommend_plugins( $recommend_plugins ); ?>

Name ); ?>

Congratulations! you installed importer plugin successfully. Click Here to start '.__('Import Data','business-a').'

', 'business-a' ), esc_url( admin_url('themes.php?page=pt-one-click-demo-import') ) ) ); ?>
'install-plugin', 'plugin' => $plugin_name ), network_admin_url( 'update.php' ) ), 'install-plugin_'.$plugin_name ); } else { $install_url = add_query_arg(array( 'action' => 'activate', 'plugin' => rawurlencode( $plugin_name . '/' . $plugin_name . '.php' ), 'plugin_status' => 'all', 'paged' => '1', '_wpnonce' => wp_create_nonce('activate-plugin_' . $plugin_name . '/' . $plugin_name . '.php'), ), network_admin_url('plugins.php')); $button_class = 'activate-now button-primary'; $button_txt = esc_html__( 'Active Now', 'business-a' ); } $detail_link = add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => $plugin_name, 'TB_iframe' => 'true', 'width' => '772', 'height' => '349', ), network_admin_url( 'plugin-install.php' ) ); echo '

'; printf( esc_html__( '%1$s you will need to install and activate the %2$s plugin first.', 'business-a' ), ''.esc_html__( 'Hey.', 'business-a' ).'', ''.esc_html__( 'Theme Demo Importer', 'business-a' ).'' ); echo '

'; echo '

'.$button_txt.'

'; ?>
$plugin_info ) { $plugin_info = wp_parse_args( $plugin_info, array( 'name' => '', 'active_filename' => '', ) ); if ( $plugin_info['active_filename'] ) { $active_file_name = $plugin_info['active_filename'] ; } else { $active_file_name = $plugin_slug . '/' . $plugin_slug . '.php'; } if ( ! is_plugin_active( $active_file_name ) ) { $actions['recommend_plugins'] = 'active'; } } } $actions = apply_filters( 'business_a_get_recommended_actions', $actions ); $hide_by_click = get_option( 'business_a_actions_dismiss' ); if ( ! is_array( $hide_by_click ) ) { $hide_by_click = array(); } $n_active = $n_dismiss = 0; $number_notice = 0; foreach ( $actions as $k => $v ) { if ( ! isset( $hide_by_click[ $k ] ) ) { $hide_by_click[ $k ] = false; } if ( $v == 'active' ) { $n_active ++ ; $number_notice ++ ; if ( $hide_by_click[ $k ] ) { if ( $hide_by_click[ $k ] == 'hide' ) { $number_notice -- ; } } } else if ( $v == 'dismiss' ) { $n_dismiss ++ ; } } $return = array( 'actions' => $actions, 'number_actions' => count( $actions ), 'number_active' => $n_active, 'number_dismiss' => $n_dismiss, 'hide_by_click' => $hide_by_click, 'number_notice' => $number_notice, ); if ( $return['number_notice'] < 0 ) { $return['number_notice'] = 0; } return $return; } public function business_a_render_recommend_plugins( $recommend_plugins = array() ){ foreach ( $recommend_plugins as $plugin_slug => $plugin_info ) { $plugin_info = wp_parse_args( $plugin_info, array( 'name' => '', 'active_filename' => '', ) ); $plugin_name = $plugin_info['name']; $plugin_desc = isset($plugin_info['desc'])?$plugin_info['desc']:''; $status = is_dir( WP_PLUGIN_DIR . '/' . $plugin_slug ); $button_class = 'install-now button'; if ( $plugin_info['active_filename'] ) { $active_file_name = $plugin_info['active_filename'] ; } else { $active_file_name = $plugin_slug . '/' . $plugin_slug . '.php'; } if ( ! is_plugin_active( $active_file_name ) ) { $button_txt = esc_html__( 'Install Now', 'business-a' ); if ( ! $status ) { $install_url = wp_nonce_url( add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $plugin_slug ), network_admin_url( 'update.php' ) ), 'install-plugin_'.$plugin_slug ); } else { $install_url = add_query_arg(array( 'action' => 'activate', 'plugin' => rawurlencode( $active_file_name ), 'plugin_status' => 'all', 'paged' => '1', '_wpnonce' => wp_create_nonce('activate-plugin_' . $active_file_name ), ), network_admin_url('plugins.php')); $button_class = 'activate-now button-primary'; $button_txt = esc_html__( 'Active Now', 'business-a' ); } $detail_link = add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => $plugin_slug, 'TB_iframe' => 'true', 'width' => '772', 'height' => '349', ), network_admin_url( 'plugin-install.php' ) ); echo '
'; echo '

'; echo esc_html( $plugin_name ); echo '

'; echo '
'; echo esc_html( $plugin_desc ); echo '
'; echo '

'.$button_txt.'

'; echo ''.esc_html__( 'Details', 'business-a' ).''; echo '
'; } } } } $GLOBALS['business_a_dashboard'] = new business_a_dashboard();