$args ) { register_term_meta( $taxonomy, $meta_key, array_merge( $args, array( 'show_in_rest' => true, 'auth_callback' => static function ( bool $allowed, string $meta_key, int $term_id ) use ( $taxonomy ): bool { return current_user_can( get_taxonomy( $taxonomy )->cap->edit_terms, $term_id ); }, ) ) ); } } } }