A WordPress-centric search engine for devs and theme authors



sanitize_category_field ›

Since2.3.0
Deprecatedn/a
sanitize_category_field ( $field, $value, $cat_id, $context )
Parameters: (4)
  • (string) $field Category key to sanitize
    Required: Yes
  • (mixed) $value Category value to sanitize
    Required: Yes
  • (int) $cat_id Category ID
    Required: Yes
  • (string) $context What filter to use, 'raw', 'display', etc.
    Required: Yes
Returns:
  • (mixed) Same type as $value after $value has been sanitized.
Defined at:
Codex:

Sanitizes data in single category key field.



Source

function sanitize_category_field( $field, $value, $cat_id, $context ) {
	return sanitize_term_field( $field, $value, $cat_id, 'category', $context );
}