taxonomy_meta_box_sanitize_cb_checkboxes( string $taxonomy, array $terms ): int[]

In this article

Sanitizes POST values from a checkbox taxonomy metabox.

Parameters

$taxonomystringrequired
The taxonomy name.
$termsarrayrequired
Raw term data from the 'tax_input' field.

Return

int[] Array of sanitized term IDs.

Source

function taxonomy_meta_box_sanitize_cb_checkboxes( $taxonomy, $terms ) {
	return array_map( 'intval', $terms );
}

Changelog

VersionDescription
5.1.0Introduced.

User Contributed Notes

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