Tribe__Tickets__Editor__Blocks__Rsvp::rsvp_form()

Function that returns the RSVP form from an AJAX call


Return

(void)


Top ↑

Source

File: src/Tribe/Editor/Blocks/Rsvp.php

	public function rsvp_form() {

		$response  = array( 'html' => '', 'view' => 'rsvp-form' );
		$ticket_id = absint( tribe_get_request_var( 'ticket_id', 0 ) );
		$going     = tribe_get_request_var( 'going', 'yes' );

		if ( 0 === $ticket_id ) {
			wp_send_json_error( $response );
		}

		$args = array(
			'ticket_id' => $ticket_id,
			'ticket'    => tribe( 'tickets.rsvp' )->get_ticket( get_the_id(), $ticket_id ),
			'going'     => $going,
		);

		$html = tribe( 'tickets.editor.template' )->template( 'blocks/rsvp/form/form', $args, false );

		$response['html']    = $html;

		wp_send_json_success( $response );

	}

Top ↑

Changelog

Changelog
Version Description
4.9 Introduced.