wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



_add_block_template_info › WordPress Function

Da5.9.0
Deprecaton/a
_add_block_template_info ( $template_item )
Accedi:
  • private
Parametri:
  • (array) $template_item Template to add information to (requires 'slug' field).
    Richiesto:
Ritorna:
  • (array) Template item.
Definito a:
Codex:

Attempts to add custom template information to the template item.



Sorgenti

function _add_block_template_info( $template_item ) {
	if ( ! wp_theme_has_theme_json() ) {
		return $template_item;
	}

	$theme_data = wp_get_theme_data_custom_templates();
	if ( isset( $theme_data[ $template_item['slug'] ] ) ) {
		$template_item['title']     = $theme_data[ $template_item['slug'] ]['title'];
		$template_item['postTypes'] = $theme_data[ $template_item['slug'] ]['postTypes'];
	}

	return $template_item;
}