_wp_get_default_posttype_form()WP 7.1.0

Builds the default form configuration for post types that don't provide their own.

It is a sensible default for post, page, and custom post types alike rather than being tailored per type. Post types that need a different shape can replace it entirely with a dedicated form through their own filter callback.

It is intentionally NOT gated by supports. The registered fields are the single source of truth for what applies: each field is registered for a post type based on its supports (and related flags such as theme_supports), and the editor drops any form field whose definition is absent or whose isVisible returns false.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Returns

array. The default form configuration.

Usage

_wp_get_default_posttype_form();

Changelog

Since 7.1.0 Introduced.

_wp_get_default_posttype_form() code WP 7.1

function _wp_get_default_posttype_form() {
	return array(
		'layout' => array( 'type' => 'panel' ),
		'fields' => array(
			array(
				'id'     => 'featured_media',
				'layout' => array(
					'type'          => 'regular',
					'labelPosition' => 'none',
				),
			),
			array(
				'id'     => 'post-content-info',
				'layout' => array(
					'type'          => 'regular',
					'labelPosition' => 'none',
				),
			),
			array(
				'id'     => 'excerpt',
				'layout' => array(
					'type'          => 'panel',
					'labelPosition' => 'top',
				),
			),
			array(
				'id'       => 'status',
				'label'    => __( 'Status' ),
				'children' => array(
					array(
						'id'     => 'status',
						'layout' => array(
							'type'          => 'regular',
							'labelPosition' => 'none',
						),
					),
					'scheduled_date',
					'password',
					'sticky',
				),
			),
			'date',
			'slug',
			'author',
			'template',
			array(
				'id'       => 'discussion',
				'label'    => __( 'Discussion' ),
				'children' => array(
					array(
						'id'     => 'comment_status',
						'layout' => array(
							'type'          => 'regular',
							'labelPosition' => 'none',
						),
					),
					'ping_status',
				),
			),
			'parent',
			'format',
			'revisions',
		),
	);
}