2021-05-25 10:20:57 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Blocks API: WP_Block_Template class
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @since 5.8.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class representing a block template.
|
|
|
|
*
|
|
|
|
* @since 5.8.0
|
|
|
|
*/
|
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
2021-12-12 09:54:00 -05:00
|
|
|
* ID.
|
2021-05-25 10:20:57 -04:00
|
|
|
*
|
|
|
|
* @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';
|
|
|
|
|
2021-11-29 19:24:27 -05:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
public $origin;
|
|
|
|
|
2021-05-25 10:20:57 -04:00
|
|
|
/**
|
2021-12-12 09:54:00 -05:00
|
|
|
* Post ID.
|
2021-05-25 10:20:57 -04:00
|
|
|
*
|
|
|
|
* @since 5.8.0
|
2021-12-11 14:50:59 -05:00
|
|
|
* @var int|null
|
2021-05-25 10:20:57 -04:00
|
|
|
*/
|
|
|
|
public $wp_id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Template Status.
|
|
|
|
*
|
|
|
|
* @since 5.8.0
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $status;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether a template is, or is based upon, an existing template file.
|
|
|
|
*
|
|
|
|
* @since 5.8.0
|
2021-11-23 16:37:01 -05:00
|
|
|
* @var bool
|
2021-05-25 10:20:57 -04:00
|
|
|
*/
|
|
|
|
public $has_theme_file;
|
2021-11-08 18:10:59 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether a template is a custom template.
|
|
|
|
*
|
|
|
|
* @since 5.9.0
|
|
|
|
*
|
2021-11-23 16:37:01 -05:00
|
|
|
* @var bool
|
2021-11-08 18:10:59 -05:00
|
|
|
*/
|
|
|
|
public $is_custom = true;
|
2021-11-29 19:24:27 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Author.
|
|
|
|
*
|
|
|
|
* A value of 0 means no author.
|
|
|
|
*
|
|
|
|
* @since 5.9.0
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
public $author;
|
2021-05-25 10:20:57 -04:00
|
|
|
}
|