Tribe__Tickets__Editor::update_tickets_block_with_childs( string $content, WP_Post $post, array $blocks )

Making sure we have correct post content for tickets blocks after going into Gutenberg


Parameters

$content

(string) (Required) Content that will be updated

$post

(WP_Post) (Required) Which post we will migrate

$blocks

(array) (Required) Which blocks we are updating with


Top ↑

Return

(bool)


Top ↑

Source

File: src/Tribe/Editor.php

	public function update_tickets_block_with_childs( $content, $post, $blocks ) {
		$search = '<!-- wp:tribe/tickets  /-->';

		// Do we have a tickets blocks already setup? (we should)
		if ( false === strpos( $content, $search ) ) {
			return $content;
		}

		$replace = $this->get_tickets_as_blocks( $post->ID );
		// Do the actual replace for tickets blocks
		$content = str_replace( $search, implode( "\n\r", $replace ), $content );

		return $content;
	}

Top ↑

Changelog

Changelog
Version Description
4.9 Introduced.