diff --git a/Admin/MPWEM_Admin.php b/Admin/MPWEM_Admin.php new file mode 100644 index 0000000..c69e701 --- /dev/null +++ b/Admin/MPWEM_Admin.php @@ -0,0 +1,63 @@ +load_file(); + add_action('init', [$this, 'add_dummy_data']); + add_filter('use_block_editor_for_post_type', [$this, 'disable_gutenberg'], 10, 2); + add_action('upgrader_process_complete', [$this, 'flush_rewrite'], 0); + //} + } + public function flush_rewrite() { + flush_rewrite_rules(); + } + private function load_file(): void { + if (!class_exists('EDD_SL_Plugin_Updater')) { + require_once MPWEM_PLUGIN_DIR . '/lib/classes/EDD_SL_Plugin_Updater.php'; + } + // require_once(dirname(__DIR__) . '/lib/classes/class-wc-product-data.php'); + require_once(dirname(__DIR__) . '/lib/classes/class-form-fields-generator.php'); + require_once(dirname(__DIR__) . '/lib/classes/class-meta-box.php'); + require_once(dirname(__DIR__) . '/lib/classes/class-taxonomy-edit.php'); + require_once(dirname(__DIR__) . "/support/elementor/elementor-support.php"); + require_once(dirname(__DIR__) . '/lib/classes/class-icon-library.php'); + require_once(dirname(__DIR__) . '/lib/classes/class-icon-popup.php'); + //****************Global settings************************// + require_once MPWEM_PLUGIN_DIR . '/Admin/settings/global/MAGE_Setting_API.php'; + require_once MPWEM_PLUGIN_DIR . '/Admin/settings/global/admin_setting_panel.php'; + //************************************// + require_once MPWEM_PLUGIN_DIR . '/Admin/mep_dummy_import.php'; + require_once MPWEM_PLUGIN_DIR . '/Admin/mep_cpt.php'; + require_once MPWEM_PLUGIN_DIR . '/Admin/status.php'; + require_once MPWEM_PLUGIN_DIR . '/Admin/MPWEM_Welcome.php'; + require_once MPWEM_PLUGIN_DIR . '/Admin/MPWEM_Quick_Setup.php'; +// //****************Taxi settings************************// +// require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_Settings.php'; +// require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_General_Settings.php'; +// require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_Price_Settings.php'; +// require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_Extra_Service.php'; +// require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_Date_Settings.php'; + //require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_Gallery_Settings.php'; + } + public function add_dummy_data() { + //new MPTBM_Dummy_Import(); + } + //************Disable Gutenberg************************// + public function disable_gutenberg($current_status, $post_type) { + $user_status = MP_Global_Function::get_settings('general_setting_sec', 'mep_disable_block_editor', 'yes'); + if ($post_type === 'mep_events' && $user_status == 'yes') { + return false; + } + return $current_status; + } + } + new MPWEM_Admin(); + } \ No newline at end of file diff --git a/Admin/MPWEM_Quick_Setup.php b/Admin/MPWEM_Quick_Setup.php new file mode 100644 index 0000000..182b936 --- /dev/null +++ b/Admin/MPWEM_Quick_Setup.php @@ -0,0 +1,296 @@ +' . esc_html__('Quick Setup', 'mage-eventpress') . '', 'manage_options', 'mpwem_quick_setup', array($this, 'quick_setup')); + add_submenu_page('mep_events', esc_html__('Quick Setup', 'mage-eventpress'), '' . esc_html__('Quick Setup', 'mage-eventpress') . '', 'manage_options', 'mpwem_quick_setup', array($this, 'quick_setup')); + } + else { + add_menu_page(esc_html__('Events', 'mage-eventpress'), esc_html__('Events', 'mage-eventpress'), 'manage_options', 'mep_events', array($this, 'quick_setup'), 'dashicons-calendar-alt', 6); + add_submenu_page('mep_events', esc_html__('Quick Setup', 'mage-eventpress'), '' . esc_html__('Quick Setup', 'mage-eventpress') . '', 'manage_options', 'mpwem_quick_setup', array($this, 'quick_setup')); + } + } + public function quick_setup() { + $status = MP_Global_Function::check_woocommerce(); + if (isset($_POST['active_woo_btn'])) { + ?> + + + + '; + include_once(ABSPATH . 'wp-admin/includes/plugin-install.php'); + 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'); + $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, + ), + )); + $title = 'title'; + $url = 'url'; + $nonce = 'nonce'; + $woocommerce_plugin = new Plugin_Upgrader(new Plugin_Installer_Skin(compact('title', 'url', 'nonce', 'plugin', 'api'))); + $woocommerce_plugin->install($api->download_link); + activate_plugin('woocommerce/woocommerce.php'); + //MPTBM_Plugin::on_activation_page_create(); + echo ''; + ?> + + $label, + 'mep_event_slug' => $slug, + 'mep_event_expire_on_datetimes' => $event_expire_on + ]; + $update_email_settings_arr = [ + 'mep_email_form_name' => $email_from_name, + 'mep_email_form_email' => $email_from_addrss + ]; + $new_general_settings_data = is_array($general_settings_data) ? array_replace($general_settings_data, $update_general_settings_arr) : $update_general_settings_arr; + $new_email_settings_data = is_array($email_settings_data) ? array_replace($email_settings_data, $update_email_settings_arr) : $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'); + wp_redirect(admin_url('edit.php?post_type=mep_events')); + } + ?> +
Name | +Shortcode | +Parameter Description | +
---|---|---|
+ Events – List Style + + | +
+ [event-list show='2' pagination='yes']
+ |
+
+ style
+ Number of events show (integer number only) | Default: + -1 + to show all + + pagination ++ yes + or + no + or + carousal + | Default: + no + + |
+
+ Events – List Style with Search Box + + | +
+ [event-list column=4 search-filter='yes']
+ |
+
+
+
+ |
+
+ Events – Grid Style + + | +
+ [event-list show='3' style='grid']
+ |
+
+
+
+ |
+
+ Events – Minimal Style + + | +
+ [event-list show='2' style='minimal']
+ |
+
+
+
+ |
+
+ Events – Winter Style + + | +
+ [event-list show='2' style='winter']
+ |
+
+
+
+ |
+
+ Events – Native Style + + | +
+ [event-list show='2' style='native']
+ |
+
+
+
+ |
+
+ Events – Vertical Timeline Style + + | +
+ [event-list show='5' style='timeline' timeline-mode='vertical']
+ |
+
+
+
+
+ |
+
+ Events – Horizontal Timeline Style + + | +
+ [event-list show='5' style='timeline' timeline-mode='horizontal']
+ |
+
+
+
+
+ |
+
+ Events list with search filter + + | +
+ [event-list show='8' style='grid' column='3' search-filter='yes']
+ |
+
+
+
+
+
+ |
+
+ Events – Title Style + + | +
+ [event-list style='title']
+ |
+
+
+ |
+
+ Events – Carousel Style + + | +
+ [event-list style='grid' pagination='carousal' carousal-dots='yes' carousal-nav='yes' column=3]
+ |
+
+
+
+
+
+
+ |
+
+ Events – Spring Style + + | +
+ [event-list style='spring']
+ |
+
+
+ |
+
+ Event Speakers + + | +
+ [event-speaker-list event=14829]
+ |
+
+
+ |
+
+ Recurring Events + + | +
+ [event-list-recurring column='3']
+ |
+
+
+ |
+
+ Events City List + + | +
+ [event-city-list]
+ |
+ + |
+ Events With Pagination + + | +
+ [event-list style='grid' pagination='yes']
+ |
+
+
+
+ |
+
+ Events by Single Organizer + + | +
+ [event-list style='grid' org='15']
+ |
+
+
+
+ |
+
+ Events Filter by Organization + + | +
+ [event-list style='grid' org-filter='yes']
+ |
+
+
+
+ |
+
+ Events by Single Category + + | +
+ [event-list cat='44']
+ |
+
+
+ |
+
+ Events Filter by Category + + | +
+ [event-list cat-filter='yes']
+ |
+
+
+ |
+
+ Events by Country + + | +
+ [event-list country='US']
+ |
+
+
+ |
+
+ Events by City + + | +
+ [event-list city='Texas']
+ |
+
+
+ |
+
+ Expired Events + + | +
+ [expire-event-list]
+ |
+ + |
+ Single Event Registration + + | +
+ [event-add-cart-section event=10408]
+ |
+
+
+ |
+
+ Events Calendar + + | +
+ [event-calendar]
+ |
+ + |
+ Events Calendar Pro + Addon + + | +
+
+
+
+ |
+
+
+
+ |
+
%s
', $args['desc'] ); } else { $desc = ''; } return $desc; } /** * Displays a text field for a settings field * * @param array $args settings field args */ function callback_text( $args ) { $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular'; $type = isset( $args['type'] ) ? $args['type'] : 'text'; $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"'; $html = sprintf( '', $type, $size, $args['section'], $args['id'], $value, $placeholder ); $html .= $this->get_field_description( $args ); echo mep_esc_html($html); } /** * Displays a url field for a settings field * * @param array $args settings field args */ function callback_url( $args ) { $this->callback_text( $args ); } /** * Displays a number field for a settings field * * @param array $args settings field args */ function callback_number( $args ) { $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular'; $type = isset( $args['type'] ) ? $args['type'] : 'number'; $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"'; $min = ( $args['min'] == '' ) ? '' : ' min="' . $args['min'] . '"'; $max = ( $args['max'] == '' ) ? '' : ' max="' . $args['max'] . '"'; $step = ( $args['step'] == '' ) ? '' : ' step="' . $args['step'] . '"'; $html = sprintf( '', $type, $size, $args['section'], $args['id'], $value, $placeholder, $min, $max, $step ); $html .= $this->get_field_description( $args ); echo mep_esc_html($html); } /** * Displays a checkbox for a settings field * * @param array $args settings field args */ function callback_checkbox( $args ) { $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); $html = ''; echo mep_esc_html($html); } /** * Displays a multicheckbox for a settings field * * @param array $args settings field args */ function callback_multicheck( $args ) { $value = $this->get_option( $args['id'], $args['section'], $args['std'] ); $html = ''; echo mep_esc_html($html); } /** * Displays a radio button for a settings field * * @param array $args settings field args */ function callback_radio( $args ) { $value = $this->get_option( $args['id'], $args['section'], $args['std'] ); $html = ''; echo mep_esc_html($html); } /** * Displays a selectbox for a settings field * * @param array $args settings field args */ function callback_select( $args ) { $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular'; $html = sprintf( '' ); $html .= $this->get_field_description( $args ); echo mep_esc_html($html); } /** * Displays a textarea for a settings field * * @param array $args settings field args */ function callback_textarea( $args ) { $value = esc_textarea( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular'; $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="'.$args['placeholder'].'"'; $html = sprintf( '', $size, $args['section'], $args['id'], $placeholder, $value ); $html .= $this->get_field_description( $args ); echo mep_esc_html($html); } /** * Displays the html for a settings field * * @param array $args settings field args * @return string */ function callback_html( $args ) { echo mep_esc_html($this->get_field_description( $args )); } /** * Displays a rich text textarea for a settings field * * @param array $args settings field args */ function callback_wysiwyg( $args ) { $value = $this->get_option( $args['id'], $args['section'], $args['std'] ); $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : '500px'; echo '
+ Event Manager For Woocommerce Environment Status+ |
+ ||
---|---|---|
WordPress Version: | ++ + | +5.5) { + echo ' ' . esc_html($wp_v) . ''; + } else { + echo ' ' . esc_html($wp_v) . ''; + } ?> | +
Woocommerce Installed: | ++ + | +' . esc_html($wc_i) . ''; + } else { + echo ' ' . esc_html($wc_i) . ''; + } ?> | +
Woocommerce Version: | ++ + | +4.8) { + echo ' ' . esc_html($wc_v) . ''; + } else { + echo ' ' . esc_html($wc_v) . ''; + } ?> | +
Email From Name: | ++ + | +' . esc_html($from_name) . ''; + } else { + echo ' '; + } ?> | +
From Email Address: | ++ + | +' . esc_html($from_email) . ''; + } else { + echo ' '; + } ?> | +