register_term_meta not working

I am echoing the “procedures” term I expect to get this meta field

get_term() returns a WP_Term object which by default does not include any metadata, even for registered meta keys.

So registering a meta key does not automatically add it to the term object, but registering a meta key has 2 main benefits:

  1. You can set a default value for the meta, which is returned when you call get_metadata() or get_term_meta(), see the default argument here.

  2. You can make the meta be accessible via the REST API, via the show_in_rest argument (see the same link above).

So for example, if you set default to 1234 and show_in_rest to true, then a request for a taxonomy’s collection in the REST API (e.g. at /wp-json/wp/v2/procedures) would contain a "meta":{"source_post_id":1234} in the JSON response, for terms without that meta.