register_block_core_latest_posts

The timeline below displays how wordpress function register_block_core_latest_posts has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * Registers the `core/latest-posts` block on server.
 */
function register_block_core_latest_posts()
{
    register_block_type_from_metadata(__DIR__ . '/latest-posts', array('render_callback' => 'render_block_core_latest_posts'));
}

WordPress Version: 5.4

/**
 * Registers the `core/latest-posts` block on server.
 */
function register_block_core_latest_posts()
{
    register_block_type('core/latest-posts', array('attributes' => array('align' => array('type' => 'string', 'enum' => array('left', 'center', 'right', 'wide', 'full')), 'className' => array('type' => 'string'), 'categories' => array('type' => 'string'), 'postsToShow' => array('type' => 'number', 'default' => 5), 'displayPostContent' => array('type' => 'boolean', 'default' => false), 'displayPostContentRadio' => array('type' => 'string', 'default' => 'excerpt'), 'excerptLength' => array('type' => 'number', 'default' => 55), 'displayPostDate' => array('type' => 'boolean', 'default' => false), 'postLayout' => array('type' => 'string', 'default' => 'list'), 'columns' => array('type' => 'number', 'default' => 3), 'order' => array('type' => 'string', 'default' => 'desc'), 'orderBy' => array('type' => 'string', 'default' => 'date'), 'displayFeaturedImage' => array('type' => 'boolean', 'default' => false), 'featuredImageAlign' => array('type' => 'string', 'enum' => array('left', 'center', 'right')), 'featuredImageSizeSlug' => array('type' => 'string', 'default' => 'thumbnail'), 'featuredImageSizeWidth' => array('type' => 'number', 'default' => null), 'featuredImageSizeHeight' => array('type' => 'number', 'default' => null)), 'render_callback' => 'render_block_core_latest_posts'));
}

WordPress Version: 5.3

/**
 * Registers the `core/latest-posts` block on server.
 */
function register_block_core_latest_posts()
{
    register_block_type('core/latest-posts', array('attributes' => array('align' => array('type' => 'string', 'enum' => array('left', 'center', 'right', 'wide', 'full')), 'className' => array('type' => 'string'), 'categories' => array('type' => 'string'), 'postsToShow' => array('type' => 'number', 'default' => 5), 'displayPostContent' => array('type' => 'boolean', 'default' => false), 'displayPostContentRadio' => array('type' => 'string', 'default' => 'excerpt'), 'excerptLength' => array('type' => 'number', 'default' => 55), 'displayPostDate' => array('type' => 'boolean', 'default' => false), 'postLayout' => array('type' => 'string', 'default' => 'list'), 'columns' => array('type' => 'number', 'default' => 3), 'order' => array('type' => 'string', 'default' => 'desc'), 'orderBy' => array('type' => 'string', 'default' => 'date')), 'render_callback' => 'render_block_core_latest_posts'));
}

WordPress Version: 5.0

/**
 * Registers the `core/latest-posts` block on server.
 */
function register_block_core_latest_posts()
{
    register_block_type('core/latest-posts', array('attributes' => array('categories' => array('type' => 'string'), 'className' => array('type' => 'string'), 'postsToShow' => array('type' => 'number', 'default' => 5), 'displayPostDate' => array('type' => 'boolean', 'default' => false), 'postLayout' => array('type' => 'string', 'default' => 'list'), 'columns' => array('type' => 'number', 'default' => 3), 'align' => array('type' => 'string'), 'order' => array('type' => 'string', 'default' => 'desc'), 'orderBy' => array('type' => 'string', 'default' => 'date')), 'render_callback' => 'render_block_core_latest_posts'));
}