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

Welcome page', 'book-land' ), esc_html( $theme->Name ), esc_url( admin_url( 'themes.php?page=wd_themepage' ) ) ); ?>

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

esc_html__( 'Activating ', 'book-land' ), ) ); wp_localize_script( 'book_land-plugin-install-helper', 'pagenow', array( 'import' ) ); } } public function book_land_about(){ $recommended_actions = $this->book_land_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, 'book-land' ), $number_count ); $count = "" . number_format_i18n($number_count) . ""; $menu_title = sprintf( esc_html__('Book Land %s', 'book-land'), $count ); } else { $menu_title = esc_html__('Book Land Theme', 'book-land'); } add_theme_page( esc_html__( 'Book Land Dashboard', 'book-land' ), $menu_title, 'edit_theme_options', 'wd_themepage', array($this,'book_land_theme_about_page') ); } public function book_land_theme_about_page(){ $theme = wp_get_theme('book-land'); if ( isset( $_GET['book_land_action_dismiss'] ) ) { $actions_dismiss = get_option( 'book_land_actions_dismiss' ); if ( ! is_array( $actions_dismiss ) ) { $actions_dismiss = array(); } $actions_dismiss[ sanitize_text_field( wp_unslash( $_GET['book_land_action_dismiss'] ) ) ] = 'dismiss'; update_option( 'book_land_actions_dismiss', $actions_dismiss ); } $tab = null; if ( isset( $_GET['tab'] ) ) { $tab = sanitize_text_field( wp_unslash( $_GET['tab']) ); } else { $tab = null; } $actions_r = $this->book_land_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(); } ?>


Book Land Theme Screen
0 ) { ?> '', 'page_template' ) ); ?>

Name ) ); ?>

Congratulations! you installed importer plugin successfully. Click Here to start Import Data

','book-land' ), 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', 'book-land' ); } $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.', 'book-land' ), ''.esc_html__( 'Hey.', 'book-land' ).'', ''.esc_html__( 'Theme Demo Importer', 'book-land' ).'' ); echo '

'; echo '

'.esc_html($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( 'book_land_get_recommended_actions', $actions ); $hide_by_click = get_option( 'book_land_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 book_land_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']; $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', 'book-land' ); 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', 'book-land' ); } $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 '

'.esc_html($button_txt).'

'; echo ''.esc_html__( 'Details', 'book-land' ).''; echo '
'; } } } } $GLOBALS['book_land_dashboard'] = new book_land_dashboard();