Tribe__Tickets__Metabox::render( int|WP_Post $post_id )

Render the actual Metabox


Parameters

$post_id

(int|WP_Post) (Required) Which post we are dealing with by ID or post object.


Top ↑

Return

(string|bool)


Top ↑

Source

File: src/Tribe/Metabox.php

	public function render( $post_id ) {
		$modules = Tribe__Tickets__Tickets::modules();
		if ( empty( $modules ) ) {
			return false;
		}

		$post = get_post( $post_id );

		// Prepare all the variables required
		$start_date = date( 'Y-m-d H:00:00' );
		$end_date   = date( 'Y-m-d H:00:00' );
		$start_time = Tribe__Date_Utils::time_only( $start_date, false );
		$end_time   = Tribe__Date_Utils::time_only( $start_date, false );

		$show_global_stock = Tribe__Tickets__Tickets::global_stock_available();
		$tickets           = Tribe__Tickets__Tickets::get_event_tickets( $post->ID );
		$global_stock      = new Tribe__Tickets__Global_Stock( $post->ID );

		return tribe( 'tickets.admin.views' )->template( array( 'editor', 'metabox' ), get_defined_vars() );
	}

Top ↑

Changelog

Changelog
Version Description
4.6.2 Introduced.