LLMS_Abstract_Generator_Posts::create_reusable_block( int $block_id, array $block )

Creates a reusable block


Parameters Parameters

$block_id

(int) (Required) WP_Post ID of the block being imported. This will be the ID as found on the original site.

$block

(array) (Required) Array of block data.

  • 'title'
    (string) Title of the reusable block.
  • 'content'
    (string) Content of the reusable block.


Top ↑

Return Return

(bool|int) The WP_Post ID of the new block on success or false on error.


Top ↑

Source Source

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

		$this->add_custom_values( $post->get( 'id' ), $raw );
		$this->sideload_images( $post, $raw );
		$this->handle_reusable_blocks( $post, $raw );

		// Remove revision prevention.
		remove_filter( 'wp_revisions_to_keep', '__return_zero', 999 );

		return $post;

	}

	/**
	 * Creates a reusable block
	 *
	 * @since 4.7.0
	 *
	 * @param int   $block_id WP_Post ID of the block being imported. This will be the ID as found on the original site.
	 * @param array $block    {
	 *     Array of block data.
	 *
	 *     @type string $title   Title of the reusable block.


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.