insights()->init(); } function mep_event_activation_redirect($plugin) { $check_quick_setup = get_option('mep_quick_setup') ? get_option('mep_quick_setup') : 'no-done'; $slug = $check_quick_setup == 'done' ? 'edit.php?post_type=mep_events&page=mep_event_welcome_page' : 'edit.php?post_type=mep_events&page=mep_event_quick_setup_page'; if ($plugin == plugin_basename(__FILE__)) { exit(wp_redirect(admin_url($slug))); } } add_action('activated_plugin', 'mep_event_activation_redirect'); require_once(dirname(__FILE__) . "/inc/mep_file_include.php"); // Get Plugin Data if(!function_exists('mep_get_plugin_data')) { function mep_get_plugin_data($data) { $get_mep_plugin_data = get_plugin_data( __FILE__ ); $mep_data = $get_mep_plugin_data[$data]; return $mep_data; } } // Added Settings link to plugin action links add_filter( 'plugin_action_links', 'mep_plugin_action_link', 10, 2 ); function mep_plugin_action_link( $links_array, $plugin_file_name ){ if( strpos( $plugin_file_name, basename(__FILE__) ) ) { array_unshift( $links_array, ''.__('Settings','mage-eventpress').''); } return $links_array; } // Added links to plugin row meta add_filter( 'plugin_row_meta', 'mep_plugin_row_meta', 10, 2 ); function mep_plugin_row_meta( $links_array, $plugin_file_name ) { if( strpos( $plugin_file_name, basename(__FILE__) ) ) { if(!is_plugin_active('woocommerce-event-manager-pdf-ticket/tickets.php') || !is_plugin_active('woocommerce-event-manager-addon-form-builder/addon-builder.php')){ $wbbm_links = array( 'docs' => ''.__('Docs','mage-eventpress').'', 'support' => ''.__('Support','mage-eventpress').'', 'get_pro' => ''.__('Upgrade to PRO Version','mage-eventpress').'' ); }else{ $wbbm_links = array( 'docs' => ''.__('Docs','mage-eventpress').'', 'support' => ''.__('Support','mage-eventpress').'' ); } $links_array = array_merge( $links_array, $wbbm_links ); } return $links_array; } } else { add_action('admin_enqueue_scripts', 'mep_add_admin_scripts', 10, 1); function mep_add_admin_scripts($hook) { wp_register_script('welcome-tabs', plugin_dir_url(__FILE__) . 'js/welcome-tabs.js', array('jquery')); wp_register_style('welcome-tabs', plugin_dir_url(__FILE__) . 'css/welcome-tabs.css'); wp_register_script('welcome-tabs', plugin_dir_url(__FILE__) . 'js/welcome-tabs.js', array('jquery')); wp_register_style('welcome-tabs', plugin_dir_url(__FILE__) . 'css/welcome-tabs.css'); } add_action('admin_menu', 'mep_event_welcome_admin_menu'); function mep_event_welcome_admin_menu(){ add_menu_page(__( 'Events', 'mage-eventpress' ), __( 'Events', 'mage-eventpress' ), 'manage_options', 'mep_events','mep_event_quick_setup_page','dashicons-calendar-alt', 6); add_submenu_page('mep_events', __('Quick Setup', 'mage-eventpress'), __('Quick Setup', 'mage-eventpress'), 'manage_options', 'mep_event_quick_setup_page', 'mep_event_quick_setup_page'); } function mep_event_quick_setup_page(){ require_once(dirname(__FILE__) . "/inc/quick_setup.php"); } }