array(
'label' => __( 'Welcome', 'gogo' ),
'show' => ! is_network_admin(),
),
);
self::$view_actions = apply_filters( 'gogo_menu_options', $actions );
}
return self::$view_actions;
}
/**
* Save All admin settings here
*/
static public function save_settings() {
// Only admins can save settings.
if ( ! current_user_can( 'manage_options' ) ){
return;
}
// Let extensions hook into saving.
do_action( 'gogo_admin_settings_save' );
}
/**
* Enqueues the needed CSS/JS for the builder's admin settings page.
*
*/
static public function styles_scripts(){
// Styles.
wp_enqueue_style( 'gogo-admin-settings', GOGO_THEME_URI . 'lib/theme-option/assets/css/gogo-admin-menu-settings.css', array(), GOGO_THEME_VERSION );
// Script.
wp_enqueue_script( 'gogo-admin-settings', GOGO_THEME_URI . 'lib/theme-option/assets/js/gogo-admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), GOGO_THEME_VERSION );
$localize = array(
'ajaxUrl' => admin_url( 'admin-ajax.php' )
);
wp_localize_script( 'gogo-admin-settings', 'gogo', apply_filters( 'gogo_theme_js_localize', $localize ) );
}
/**
* Enqueues the needed CSS/JS for Backend.
*
*/
static public function admin_scripts(){
// Styles.
wp_enqueue_style( 'gogo-admin', GOGO_THEME_URI . 'lib/theme-option/assets/css/gogo-admin.css', array(), GOGO_THEME_VERSION );
}
/**
* Add main menu
*
*/
static public function add_admin_menu() {
$parent_page = self::$default_menu_position;
$page_title = self::$menu_page_title;
$capability = 'manage_options';
$page_menu_slug = self::$plugin_slug;
$page_menu_func = __CLASS__ . '::menu_callback';
if ( apply_filters( 'gogo_dashboard_admin_menu', true ) ) {
add_theme_page( $page_title, $page_title, $capability, $page_menu_slug, $page_menu_func );
} else {
do_action( 'gogo_register_admin_menu', $parent_page, $page_title, $capability, $page_menu_slug, $page_menu_func );
}
}
/**
* Menu callback
*
*/
static public function menu_callback() {
$current_slug = isset( $_GET['action'] ) ? esc_attr( $_GET['action'] ) : self::$current_slug;
$active_tab = str_replace( '_', '-', $current_slug );
$current_slug = str_replace( '-', '_', $current_slug );
$gogo_icon = apply_filters( 'gogo_page_top_icon', true );
$ast_visit_site_url = apply_filters( 'gogoa_site_url', 'https://gogo.com' );
$ast_wrapper_class = apply_filters( 'gogo_welcome_wrapper_class', array( $current_slug ) );
$my_theme = wp_get_theme();
$gogo_theme_version = $my_theme->get( 'Version' );
?>
' . esc_html( $gogo_knowledge_base_doc_link_text ) . '' :
esc_html( $gogo_knowledge_base_doc_link_text )
);
?>
' . esc_html( $gogo_community_group_link_text ) . '' :
esc_html( $gogo_community_group_link_text )
);
?>
' . esc_html( $gogo_support_link_text ) . '' :
esc_html( $gogo_support_link_text )
);
?>
' . esc_html( $gogo_pro_link_text ) . '' :
esc_html( $gogo_pro_link_text )
);
?>
$plugin){
$plugin_info = plugins_api( 'plugin_information', array(
'slug' => $slug,
'fields' => array(
'downloaded' => false,
'sections' => true,
'homepage' => true,
'added' => false,
'compatibility' => false,
'requires' => false,
'downloadlink' => false,
'icons' => false,
)
) );
$plugin_name = $plugin_info->name;
$plugin_slug = $plugin_info->slug;
$version = $plugin_info->version;
$author = $plugin_info->author;
$download_link = $plugin_info->download_link;
$status = is_dir( WP_PLUGIN_DIR . '/' . $plugin_slug );
if($plugin_slug=='themehunk-megamenu-plus'){
$active_file_name = $plugin_slug . '/themehunk-megamenu.php';
}else{
$active_file_name = $plugin_slug . '/' . $plugin_slug . '.php';
}
$button_class = 'install-now button '.$plugin_slug;
if ( is_plugin_active( $active_file_name ) ) {
$button_class = 'button disabled '.$plugin_slug;
$button_txt = esc_html__( 'Plugin Activated', 'gogo' );
$detail_link = $install_url = '';
}
if ( ! is_plugin_active( $active_file_name ) ){
$button_txt = esc_html__( 'Install Now', 'gogo' );
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 '.$plugin_slug;
$button_txt = esc_html__( 'Activate Now', 'gogo' );
}
$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' )
);
}
$detail = '';
echo '';
echo '
';
echo esc_html( $plugin_name );
echo ' ';
if($plugin_slug=='lead-form-builder'){
echo'
';
$detail='Lead form builder is a contact form as well as lead generator plugin.';
}elseif($plugin_slug=='hunk-companion'){
echo'
';
$detail= 'Hunk Companion contain all features which are required to create a complete website. Main motive behind this plugin is to boost up functionality of ThemeHunk themes. This plugin will work for Gogo WordPress theme and upcoming ThemeHunk themes.';
}elseif($plugin_slug=='woocommerce'){
echo'
';
$detail='WooCommerce is a free eCommerce plugin that allows you to sell anything, beautifully.';
}elseif($plugin_slug=='elementor'){
echo'
';
$detail='The most advanced frontend drag & drop page builder. Create high-end, pixel perfect websites at record speeds. Any theme, any page, any design.';
}elseif($plugin_slug=='wp-popup-builder'){
echo'
';
$detail='WP Popup Builder is a powerfull tool to create amazing popup form for your site.';
}elseif($plugin_slug=='themehunk-megamenu-plus'){
echo'
';
$detail= 'ThemeHunk Megamenu ThemeHunk Megamenu is a free, fast and most user friendly plugin available for WordPress.';
}
echo '
'.esc_html($detail).'
';
echo '
Version:'.esc_html($version).'
'.$author.'
| '.esc_html__( 'Details', 'gogo' ).'
';
echo'
'.esc_html($button_txt).' ';
echo '
';
}
}
}
/**
* Update Admin Title.
*
* @since 1.0.19
*
* @param string $admin_title Admin Title.
* @param string $title Title.
* @return string
*/
static public function gogo_admin_title( $admin_title, $title ) {
$screen = get_current_screen();
if ( 'appearance_page_gogo' == $screen->id ) {
$view_actions = self::get_view_actions();
$current_slug = isset( $_GET['action'] ) ? esc_attr( $_GET['action'] ) : self::$current_slug;
$active_tab = str_replace( '_', '-', $current_slug );
if ( 'general' != $active_tab && isset( $view_actions[ $active_tab ]['label'] ) ) {
$admin_title = str_replace( $title, $view_actions[ $active_tab ]['label'], $admin_title );
}
}
return $admin_title;
}
/**
* Gogo Header Right Section Links
*
* @since 1.2.4
*/
static public function top_header_right_section(){
$top_links = apply_filters(
'gogo_header_top_links',
array(
'gogo-theme-info' => array(
'title' => __( 'Easy to use, Fully Customizable, Unique options', 'gogo' ),
),
)
);
if ( ! empty( $top_links ) ) {
?>
$info ) {
/* translators: %1$s: Top Link URL wrapper, %2$s: Top Link URL, %3$s: Top Link URL target attribute */
printf(
'<%1$s %2$s %3$s > %4$s %1$s>',
isset( $info['url'] ) ? 'a' : 'span',
isset( $info['url'] ) ? 'href="' . esc_url( $info['url'] ) . '"' : '',
isset( $info['url'] ) ? 'target="_blank" rel="noopener"' : '',
esc_html( $info['title'] )
);
}
?>
'_wp_page_template',
'meta_value' => 'gogo-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' => esc_html__('Home','gogo'),
'post_content' => '',
'post_name' => 'gogo-front',
'post_status' => 'publish',
'comment_status' => 'closed', // if you prefer
'ping_status' => 'closed', // if you prefer
'page_template' =>'gogo-frontpage.php', //Sets the template for the page.
));
}
if($post_id){
update_option( 'page_on_front', $post_id );
update_option( 'show_on_front', 'page' );
}
}
}
new Gogo_Admin_Settings;
}