Remove the Preview Step

Remove the Preview Step

In this guide, you will learn about how you can remove the preview step in the Event Submission form.

The event submission process can be simplified by removing the preview steps.

You need to do the following things:

  • Remove the Preview step.
  • Change preview text to ‘Submit Event’.
  • Manually publish events (from the admin panel or based on settings, it will auto publish).

Add the following code to your functions.php to accomplish that:


  1. /**
  2.  * Remove the preview step. Code goes in theme functions.php or a custom plugin. * @param  array $steps
  3.  * @return array
  4.  */
  5. function custom_submit_event_steps( $steps ) {
  6.     unset( $steps['preview'] );
  7.     return $steps;
  8. }
  9. add_filter( 'submit_event_steps', 'custom_submit_event_steps' );
  10.  /**
  11.  * Change button text
  12.  */
  13. function change_preview_text() {
  14.     return __( 'Submit Event','wp-event-manager' );
  15. }
  16. add_filter( 'submit_event_form_submit_button_text', 'change_preview_text' );
  17. /**
  18.  * Since we removed the preview step and its handler, we need to manually publish events
  19.  * @param  int $event_id
  20.  */
  21. function submit_event_without_preview_step( $event_id )
  22. {
  23.     $event = get_post( $event_id );
  24.     if ( in_array( $event->post_status, array( 'preview', 'expired' ) ) ) {
  25.         // Reset expiry date
  26.         delete_post_meta( $event->ID, '_event_expiry_date' );
  27.  
  28.         // Update event listing        
  29. $update_event                  = array();
  30.         $update_event['ID']            = $event->ID;
  31.         $update_event['post_status']   = get_option( 'event_manager_submission_requires_approval' ) ? 'pending' : 'publish';
  32.         $update_event['post_date']     = current_time( 'mysql' );
  33.         $update_event['post_date_gmt'] = current_time( 'mysql', 1 );
  34.         wp_update_post( $update_event );
  35.     }
  36. }
  37. add_action( 'event_manager_event_submitted', 'submit_event_without_preview_step' );


    • Related Articles

    • Remove the Preview Step

      In this guide, you will learn about how you can remove the preview step in the Event Submission form. The event submission process can be simplified by removing the preview steps. You need to do the following things: Remove the Preview step. Change ...
    • Remove existing field from event submission form

      Removing fields from event the event submission form In this guide, you will learn about how you can remove existing fields from the event submission form and how you can remove some social fields from the organizer section. Remove existing field ...
    • How To Remove Duplicate Event Type Meta Box While Using Gutenberg Editor

      In order to remove a duplicate event type meta box while using Gutenberg editor, you need to follow the below mentioned steps: Open your child theme. Enter the following code in your functions.php file. add_filter( 'rest_prepare_taxonomy', ...
    • Importing Event Listings With WP All Import Pro

      WP All Import Pro allows you to import posts and custom post categories (like occasional postings) with CSV and XML documents. Steps for importing from a CSV file are given below. Preparing Your CSV File Event Title. Event Description. Event ...
    • Event listings throw 404 page error

      Users may come across the 404 error while accessing the event listings. In this article, we will tell you how you can solve this issue. Here are the steps you need to take to solve this issue: Make sure that it is not a permalink issue: Go to your ...