add_action('publish_post'. 'add_custom_field_automatically');
You have a period in the second add_action. This should be a comma 🙂
Related Posts:
- post meta data clearing on autosave
- Is there a way to set default custom fields when creating a post?
- Is there any action filter/hook for validating a custom field before publishing the post?
- Add subtitle to Woocommerce product title
- WP doesn’t show Array Custom Fields?
- Add new “Insert Into Post” button with another function
- getEntityRecord without knowing the post type
- Add meta data to the menu
- Get updated meta data after save_post hook
- Check before publishing, if already exist post with current custom field value
- can you set a default value to a custom field
- Guest Author – How can I use custom fields to create guest author link?
- Display info from custom fields in all images’ HTML
- Using custom fields in a filter hook
- Update meta values with AJAX
- Add input field to ‘Pages > Edit Page’ through functions.php
- Auto-add paragraphs to custom field?
- Add description text under input field for new profile fields
- How to add a predefined custom field without using a plugin?
- Populate Custom Field Dropdown on Theme Install?
- Registration and Profile custom field
- How to add content at the end of posts?
- How to update a meta field of type array in Gutenberg
- how to put a custom field value in variable
- Auto Populate Custom Field with Complex Value That Increase by One?
- Custom Metabox Not Saving
- Getting the ID of any image for use in functions.php
- Auto-remove custom field with no value on publish
- Display custom field values from posts on frontpage
- Send email with custom fields after new draft is saved or new post published
- Hook after meta created
- Specific coditional usage [closed]
- Can’t save custom field on registration page
- Hide custom fields when empty
- How to disable Edit Post and Allow only Custom Field?
- Best Way to get facebook share count and update using wp_schedule_event or any other method
- No result update a custom field using wp_schedule_event
- Custom metabox not working
- Stripping and/or altering the content of a custom field (video URL)
- Odd functions.php issue in WordPress
- Using Custom Fields to Trigger Specific Actions on Saving a Post?
- Why isn’t update_post_meta saving?
- How do I get the value of a current user’s custom field?
- How to echo the translated custom field?
- change attachment custom field onChange event
- Change event firing in wordpress
- Incorrect data after modifying post using backlink from wp_die
- Add custom fields after post/page title
- Meta boxes not displayed, data isn’t being saved
- Calling Custom Field within Function wrapped with Divs.
- Get fields from metabox array
- Including inline Custom Fields info with add_filter in functions.php
- Add custom fields to specific menus
- Set new url from custom post field
- Appending an ACF custom field to the page title
- Order by a meta field in query loop
- Assign class to Drop Down Selections in WooCommerce Products Custom Fields
- Grouped Custom Meta Fields without plugin
- How to display search query as formatted text?
- Problem display
- Google not index my Custom 404 page ?why?
- Dynamic background image used in css after selector
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- Show/Hide Featured Image or replace it with custom field [closed]
- How to create a searchable database with a single-field search box at the front end? [closed]
- Tons of Custom Fields [closed]
- How can i put a custom field inside this php
- Assign new post author IF another user in custom field on post transition
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- Custom Fields after update to WordPress 6
- image_size with respect to aspect ratios
- get_term_by() returning null on plugin
- Custom fields: Split data from single custom field’s sub-array to separate custom fields when saving post
- How can I copy value from dropdown once I select it to text area as text?
- Dynamically update Custom Fields to display new dates
- Site uses wpdb to fetch meta_keys but just displays first meta_key from a page (the post uses the same meta_key “filmmaker” more than once)
- How to get all specific fields from one ACF Group?
- How to Add Extra Text In WordPress Title Before Post Publish
- How to apply Local Business Google Schema dynamically on a Custom Post single template?
- Create taxonomy terms from custom field values
- Add fields to edit in custom widget
- Save Custom Meta Value on Media Upload
- Archive for custom fields?
- Truncating characters in Advanced Custom Fields works some places but not others?
- How to make donation button dynamic on chariti theme [closed]
- Change Post status based on custom field date +1 day
- Add CSS class to posts with certain meta key
- Is there a way to read JSON data inside Custom Fields without editing PHP? [closed]
- save all acf options in one meta_value [closed]
- Conditional display based on ACF checkbox
- How to add new Metadata options (Date, Author, etc.) for Posts?
- transition_post_status hook, works – but not if the post is new
- WP Query Args – search by meta_key or title
- acf field repeater link don’t work
- Can running a WP-Cron to update_post_meta cause performance issues?
- custom field value is blank or empty
- delete_term is not working properly with add_action()
- Get category of post inside save_post hook
- Saving multiple custom meta box fields
- How to add an ACF only for parent term?