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' ).'' ); ?>

'; echo '

'.__( 'Customizer Section Manager', 'onepress' ).'

'; echo '

'.__( 'Disable (or enable) unused sections to improve Customizer loading speed. Your section settings is still saved.', 'onepress' ).'

'; echo '
'; echo '
'; foreach( $sections as $key => $section ) { $this->render_section_settings( $key, $section ); } if ( ! class_exists( 'OnePress_Plus' ) ) { foreach ( Onepress_Config::get_plus_sections() as $key => $section ) { $this->render_section_settings( $key, $section, true ); } } echo '
'; submit_button( ); 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(); } ?>

Version ); ?>

FameThemes
sections_settings(); ?>

Name ); ?>

'; $select .= ''; $select .= ''; $select .= ''; $select .=''; $select_2 = ''; echo $select . ' to '. $select_2; ?>

0 ) { ?> '', 'page_template' ) ) ?>

render_recommend_plugins( $recommend_plugins ); ?>

Name ); ?>

OnePressOnePress Plus

WooCommerce Support

Hero Section

- Full Screen
- Background Video
- Background Slides
2 Unlimited

About Section

- Number of items
3 Unlimited

Service Section

- Number of items
4 Unlimited

Counter Section

- Number of counter items
4 Unlimited

Team Section

- Number of members
4 Unlimited

Latest News Section

Contact Section

Drag and drop section orders

Add New Section

Styling for all sections

Google Map Section

Pricing Section

Testimonial Section

Call To Action Section

Projects Section

Typography Options

Footer Copyright Editor

24/7 Priority Support

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

'; echo '

'.$button_txt.'

'; ?>
$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', 'onepress' ); 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', 'onepress' ); } $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 '

'.$button_txt.'

'; echo ''.esc_html__( 'Details', 'onepress' ).''; echo '
'; } } } function admin_dismiss_actions(){ // Action for dismiss if ( isset( $_GET['onepress_action_notice'] ) ) { $actions_dismiss = get_option( 'onepress_actions_dismiss' ); if ( ! is_array( $actions_dismiss ) ) { $actions_dismiss = array(); } $action_key = sanitize_text_field( $_GET['onepress_action_notice'] ); if ( isset( $actions_dismiss[ $action_key ] ) && $actions_dismiss[ $action_key ] == 'hide' ){ $actions_dismiss[ $action_key ] = 'show'; } else { $actions_dismiss[ $action_key ] = 'hide'; } update_option( 'onepress_actions_dismiss', $actions_dismiss ); $url = wp_unslash( $_SERVER['REQUEST_URI'] ); $url = remove_query_arg( 'onepress_action_notice', $url ); wp_redirect( $url ); die(); } // Action for copy options if ( isset( $_POST['copy_from'] ) && isset( $_POST['copy_to'] ) ) { $from = sanitize_text_field( $_POST['copy_from'] ); $to = sanitize_text_field( $_POST['copy_to'] ); if ( $from && $to ) { $mods = get_option("theme_mods_" . $from); update_option("theme_mods_" . $to, $mods); $url = wp_unslash( $_SERVER['REQUEST_URI'] ); $url = add_query_arg(array('copied' => 1), $url); wp_redirect($url); die(); } } } /** * Get theme actions required * * @return array|mixed|void */ function get_recommended_actions( ) { $actions = array(); $front_page = get_option( 'page_on_front' ); $actions['page_on_front'] = 'dismiss'; $actions['page_template'] = 'dismiss'; $actions['recommend_plugins'] = 'dismiss'; if ( 'page' != get_option( 'show_on_front' ) ) { $front_page = 0; } if ( $front_page <= 0 ) { $actions['page_on_front'] = 'active'; $actions['page_template'] = 'active'; } else { if ( get_post_meta( $front_page, '_wp_page_template', true ) == 'template-frontpage.php' ) { $actions['page_template'] = 'dismiss'; } else { $actions['page_template'] = 'active'; } } $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(); } if ( ! empty( $recommend_plugins ) ) { foreach ( $recommend_plugins as $plugin_slug => $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( 'onepress_get_recommended_actions', $actions ); $hide_by_click = get_option( 'onepress_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; } } Onepress_Dashboard::get_instance()->init();