Migrate activity meta functions to the WP metadata API.
See #4551
Props boonebgorges, johnjamesjacoby