WP_REST_Comments_Controller::check_post_type_supports_notes( string $post_type ): bool

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Check if post type supports notes.

Parameters

$post_typestringrequired
Post type name.

Return

bool True if post type supports notes, false otherwise.

Source

private function check_post_type_supports_notes( $post_type ) {
	$supports = get_all_post_type_supports( $post_type );
	if ( ! isset( $supports['editor'] ) ) {
		return false;
	}
	if ( ! is_array( $supports['editor'] ) ) {
		return false;
	}
	foreach ( $supports['editor'] as $item ) {
		if ( ! empty( $item['notes'] ) ) {
			return true;
		}
	}
	return false;
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.