wppaste
WordPress

WP_Block_Template

Since
5.8.0
Source
wp-includes/class-wp-block-template.php:14
Class representing a block template.

Compatibility

WordPress
since 5.8.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 18

$typestringpublic
Type: wp_template.
$themestringpublic
Theme.
$slugstringpublic
Template slug.
$idstringpublic
ID.
$titlestringpublic
Title.
$contentstringpublic
Content.
$descriptionstringpublic
Description.
$sourcestringpublic
Source of the content. theme and custom is used for now.
$originstring|nullpublic
Origin of the content when the content has been customized.
$wp_idint|nullpublic
Post ID.
$statusstringpublic
Template Status.
$has_theme_fileboolpublic
Whether a template is, or is based upon, an existing template file.
$is_customboolpublic
Whether a template is a custom template.
$authorint|nullpublic
Author.
$pluginstring|nullpublic
Plugin.
$post_typesstring[]|nullpublic
Post types.
$areastring|nullpublic
Area.
$modifiedstring|nullpublic
Modified.

Source code

#[AllowDynamicProperties]class WP_Block_Template { 	/**	 * Type: wp_template.	 *	 * @since 5.8.0	 * @var string	 */	public $type; 	/**	 * Theme.	 *	 * @since 5.8.0	 * @var string	 */	public $theme; 	/**	 * Template slug.	 *	 * @since 5.8.0	 * @var string	 */	public $slug; 	/**	 * ID.	 *	 * @since 5.8.0	 * @var string	 */	public $id; 	/**	 * Title.	 *	 * @since 5.8.0	 * @var string	 */	public $title = ''; 	/**	 * Content.	 *	 * @since 5.8.0	 * @var string	 */	public $content = ''; 	/**	 * Description.	 *	 * @since 5.8.0	 * @var string	 */	public $description = ''; 	/**	 * Source of the content. `theme` and `custom` is used for now.	 *	 * @since 5.8.0	 * @var string	 */	public $source = 'theme'; 	/**	 * Origin of the content when the content has been customized.	 * When customized, origin takes on the value of source and source becomes	 * 'custom'.	 *	 * @since 5.9.0	 * @var string|null	 */	public $origin; 	/**	 * Post ID.	 *

Changelog

Introduced in 5.8.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/class-wp-block-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.