eventsmanager icon

Intercept manual bookings message

eventsmanager | PRO | 10/23/24 04:40:06 AM UTC | 0 ⭐ | 638 👁️ | Never ⏰ | []
text |

1.02 KB

|

None

|

0 👍

/

0 👎

<?php
 //shared: https://eventsmanagerpro.com/support/thread/manual-booking-success-message/
// Add view/edit manual booking link to booking success message
add_filter('em_action_booking_add', 'em_action_add_booking',100,2);
function em_action_add_booking( $feedback, $EM_Booking) {
    if ($feedback['result'] && $feedback['success']) {
        if (isset($EM_Booking->booking_id) && isset($EM_Booking->event_id)) {
            $booking_id = (int) $EM_Booking->booking_id;
            $event_id = (int) $EM_Booking->event_id;
            $booking_url = add_query_arg( array(
                'post_type' => 'event',
                'page' => 'events-manager-bookings',
                'event_id' => $event_id,
                'booking_id' => $booking_id,
            ), admin_url( 'edit.php' ) );
            $add_view_link = '<a href="' . $booking_url . '"">'.__('View/edit booking','em-pro').'</a>';
            $feedback["message"] = $feedback["message"] . ' | ' . $add_view_link;
        }
    }
    return $feedback;
}
 

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎