LLMS_Abstract_Generator_Posts::handle_reusable_blocks( LLMS_Post_Model $post, array $raw )

Handle importing of reusable blocks stored in post content


Parameters Parameters

$post

(LLMS_Post_Model) (Required) Instance of a post model.

$raw

(array) (Required) Array of raw data.


Top ↑

Return Return

(null|bool) Returns null when importing is disabled, false when there are no blocks to import, and true on success.


Top ↑

Source Source

File: includes/abstracts/llms-abstract-generator-posts.php

			/**
			 * Triggered when a new term is generated during an import
			 *
			 * @since 4.7.0
			 *
			 * @param array  $term Term information array from `wp_insert_term()`.
			 * @param string $tax  Taxonomy name.
			 */
			do_action( 'llms_generator_new_term', $term, $tax );

		}

		return $term['term_id'];

	}

	/**
	 * Handle importing of reusable blocks stored in post content
	 *
	 * @since 4.7.0
	 *
	 * @param LLMS_Post_Model $post Instance of a post model.
	 * @param array           $raw  Array of raw data.
	 * @return null|bool Returns `null` when importing is disabled, `false` when there are no blocks to import, and `true` on success.
	 */
	protected function handle_reusable_blocks( $post, $raw ) {

		// Importing blocks is disabled.
		if ( ! $this->is_reusable_block_importing_enabled() ) {
			return null;
		}

		// No blocks to import.
		if ( empty( $raw['_extras']['blocks'] ) ) {


Top ↑

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.