Tribe_Tickets_Protected_Content

Class for Shortcode Tribe_Tickets_Protected_Content.


Source #

File: src/Tribe/Shortcode/Tribe_Tickets_Protected_Content.php

class Tribe_Tickets_Protected_Content extends Shortcode_Abstract {

	use Protected_Content;

	/**
	 * {@inheritDoc}
	 */
	protected $slug = 'tribe_tickets_protected_content';

	/**
	 * {@inheritDoc}
	 */
	protected $default_arguments = [
		'post_id'        => null,
		'ticket_ids'     => null,
		'not_ticket_ids' => null,
		'on'             => null,
		'type'           => 'ticket',
		'ticketed'       => 1,
	];

	/**
	 * {@inheritDoc}
	 */
	public $validate_arguments_map = [
		'post_id'        => 'tribe_post_exists',
		'type'           => 'sanitize_title_with_dashes',
		'ticketed'       => 'boolval',
	];

	/**
	 * {@inheritDoc}
	 */
	public function get_html() {
		$args = $this->get_arguments();

		// Let the trait know what called this.
		$args['context'] = $this->get_registration_slug();

		// Can they see the content?
		if ( ! $this->can_see_content( $args ) ) {
			return '';
		}

		// Return content with shortcodes processed (support embedded shortcodes).
		return do_shortcode( $this->content );
	}

}

Top ↑

Changelog #

Changelog
Version Description
4.12.1 Introduced.

Top ↑

Methods #