get_recommended_actions(); $number_count = $actions['number_notice']; if ( $number_count > 0 ){ $update_label = sprintf( _n( '%1$s action required', '%1$s actions required', $number_count, 'onepress' ), $number_count ); $count = "" . number_format_i18n($number_count) . ""; $menu_title = sprintf( esc_html__('OnePress Theme %s', 'onepress'), $count ); } else { $menu_title = esc_html__('OnePress Theme', 'onepress'); } add_theme_page( esc_html__( 'OnePress Dashboard', 'onepress' ), $menu_title, 'edit_theme_options', 'ft_onepress', array( $this, 'theme_info_page' )); } /** * Add admin notice when active theme, just show one timetruongsa@200811 * * @return bool|null */ function admin_notice() { $actions = $this->get_recommended_actions(); $number_action = $actions['number_notice']; if ( $number_action > 0 ) { $theme_data = wp_get_theme(); ?>
Welcome page', 'onepress' ), $theme_data->Name, admin_url( 'themes.php?page=ft_onepress' ) ); ?>
'ft_onepress&tab=demo-data-importer' ), admin_url( 'themes.php' ) ) ).'">'.esc_html__( 'Import Demo Data', 'onepress' ).'' ); ?>
'.__( 'Disable (or enable) unused sections to improve Customizer loading speed. Your section settings is still saved.', 'onepress' ).'
'; echo ''; echo ''; } function theme_info_page() { $theme_data = wp_get_theme('onepress'); if ( isset( $_GET['onepress_action_dismiss'] ) ) { $actions_dismiss = get_option( 'onepress_actions_dismiss' ); if ( ! is_array( $actions_dismiss ) ) { $actions_dismiss = array(); } $actions_dismiss[ sanitize_text_field( $_GET['onepress_action_dismiss'] ) ] = 'dismiss'; update_option( 'onepress_actions_dismiss', $actions_dismiss ); } // Check for current viewing tab $tab = null; if ( isset( $_GET['tab'] ) ) { $tab = sanitize_text_field( $_GET['tab'] ); } else { $tab = null; } $actions_r = $this->get_recommended_actions(); $number_action = $actions_r['number_notice']; $actions = $actions_r['actions']; $current_action_link = admin_url( 'themes.php?page=ft_onepress&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(); } ?>'; printf( esc_html__( '%1$s you will need to install and activate the %2$s plugin first.', 'onepress' ), ''.esc_html__( 'Hey.', 'onepress' ).'', ''.esc_html__( 'FameThemes Demo Importer', 'onepress' ).'' ); echo '
'; echo ''; ?>