register_term_meta

函数


register_term_meta ( $taxonomy, $meta_key, $args )
参数
  • (string)
    $taxonomy
    Taxonomy to register a meta key for. Pass an empty string to register the meta key across all existing taxonomies.
    Required:
  • (string)
    $meta_key
    The meta key to register.
    Required:
  • (array)
    $args
    Data used to describe the meta key when registered. See {@see} for a list of supported arguments.
    Required:
返回值
  • (bool) True if the meta key was successfully registered, false if not.
定义位置
  • wp-includes/taxonomy.php
    , line 1466
引入
4.9.8
弃用

Registers a meta key for terms.

function register_term_meta( $taxonomy, $meta_key, array $args ) {
	$args['object_subtype'] = $taxonomy;

	return register_meta( 'term', $meta_key, $args );
}