add_action('publish_post'. 'add_custom_field_automatically');
You have a period in the second add_action. This should be a comma 🙂
add_action('publish_post'. 'add_custom_field_automatically');
You have a period in the second add_action. This should be a comma 🙂