'start', 'title' => sprintf(__('%s Welcome','mage-eventpress'),''), 'priority' => 1, 'active' => true, ); $mep_settings_tab[] = array( 'id' => 'general', 'title' => sprintf(__('%s General','mage-eventpress'),''), 'priority' => 2, 'active' => false, ); $mep_settings_tab[] = array( 'id' => 'done', 'title' => sprintf(__('%s Done','mage-eventpress'),''), 'priority' => 4, 'active' => false, ); $mep_settings_tab = apply_filters('qa_welcome_tabs', $mep_settings_tab); $tabs_sorted = array(); foreach ($mep_settings_tab as $page_key => $tab) $tabs_sorted[$page_key] = isset( $tab['priority'] ) ? $tab['priority'] : 0; array_multisort($tabs_sorted, SORT_ASC, $mep_settings_tab); wp_enqueue_style('font-awesome-5'); if (!function_exists('mep_woo_install_check')) { function mep_woo_install_check() { include_once(ABSPATH . 'wp-admin/includes/plugin.php'); $plugin_dir = ABSPATH . 'wp-content/plugins/woocommerce'; if (is_plugin_active('woocommerce/woocommerce.php')) { return 'Yes'; } elseif (is_dir($plugin_dir)) { return 'Installed But Not Active'; } else { return 'No'; } } } add_action('mep_quick_setup_header','mep_woo_quick_setup_action',90); function mep_woo_quick_setup_action(){ if(isset($_POST['active_woo_btn'])){ activate_plugin('woocommerce/woocommerce.php' ); ?> '; include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api.. $plugin = 'woocommerce'; $api = plugins_api( 'plugin_information', array( 'slug' => $plugin, 'fields' => array( 'short_description' => false, 'sections' => false, 'requires' => false, 'rating' => false, 'ratings' => false, 'downloaded' => false, 'last_updated' => false, 'added' => false, 'tags' => false, 'compatibility' => false, 'homepage' => false, 'donate_link' => false, ), )); //includes necessary for Plugin_Upgrader and Plugin_Installer_Skin include_once( ABSPATH . 'wp-admin/includes/file.php' ); include_once( ABSPATH . 'wp-admin/includes/misc.php' ); include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) ); $upgrader->install($api->download_link); activate_plugin('woocommerce/woocommerce.php' ); echo ''; } if(isset($_POST['finish_quick_setup'])){ $url = (isset($_SERVER['HTTPS']) ? "" : "") . "$_SERVER[HTTP_HOST]"; $event_label = isset($_POST['event_label']) ? sanitize_text_field($_POST['event_label']) : 'Events'; $event_slug = isset($_POST['event_slug']) ? sanitize_text_field($_POST['event_slug']) : 'event'; $event_expire_on = isset($_POST['event_expire_on']) ? sanitize_text_field($_POST['event_expire_on']) : 'event_expire_datetime'; $email_from_name = isset($_POST['email_from_name']) ? sanitize_text_field($_POST['email_from_name']) : get_bloginfo('name'); $email_from_addrss = isset($_POST['email_from_address']) ? sanitize_text_field($_POST['email_from_address']) : "no-reply@$url"; $general_settings_data = get_option('general_setting_sec') ? get_option('general_setting_sec') : []; $email_settings_data = get_option('email_setting_sec') ? get_option('email_setting_sec') : []; $update_general_settings_arr = [ 'mep_event_label' => $event_label, 'mep_event_expire_on_datetimes' => $event_expire_on, 'mep_event_slug' => $event_slug ]; $update_email_settings_arr = [ 'mep_email_form_name' => $email_from_name, 'mep_email_form_email' => $email_from_addrss ]; $new_general_settings_data = array_replace($general_settings_data,$update_general_settings_arr); $new_email_settings_data = array_replace($email_settings_data,$update_email_settings_arr); update_option( 'general_setting_sec', $new_general_settings_data); update_option( 'email_setting_sec', $new_email_settings_data); update_option( 'mep_quick_setup', 'done'); flush_rewrite_rules(); wp_redirect(admin_url('edit.php?post_type=mep_events&page=mep_event_welcome_page')); } } add_action('mep_quick_setup_content_start', 'mep_quick_setup_welcome_content'); function mep_quick_setup_welcome_content($tab){ mep_quick_setup_start(); } add_action('mep_quick_setup_content_general', 'mep_quick_setup_general_content'); function mep_quick_setup_general_content($tab){ mep_quick_setup_general(); } add_action('mep_quick_setup_content_done', 'mep_quick_setup_done_content'); function mep_quick_setup_done_content($tab){ mep_quick_setup_done(); } do_action('mep_quick_setup_header'); ?>
Permalinks hit the Save Settings button','mage-eventpress'); ?> |
||