Your code is working but its not going to print to the screen anything because save_post running in ajax. You can debug the action with the error_log()
.
First in the wp-config.php you need to turn debug and set it to log into file instead of display
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
It will create you a file in the folder wp-content in the name debug.log
And then you can use error_log()
to debug like this:
function get_acf_value ($post_id) {
$v = get_field('field_5b1d13fce338d', $post_id);
error_log($v);
// Incase it is array you can use print_r
error_log( print_r( $v, true ) );
}
add_action( 'acf/save_post', 'get_acf_value' );
Related Posts:
- How to import CSV into Custom Post Type custom fields?
- ACF – get fields from group
- update_post_meta and update_field ony working when saving the post
- How to get “Additional CSS Class” for ACF Gutenberg block
- Advanced Custom Fields select field : How to echo the label, not the value? [closed]
- ACF: get_field() returning false [closed]
- Adding custom fields to the header.php
- How to get_terms() only of terms matching an ACF meta value?
- Query between dates using Date Picker fields
- Advanced custom field – gallery – display one random image
- Showing an ACF field in admin posts dashboard
- Google Places API With ACF [closed]
- Check for the existence of custom field
- ACF Repeater Field, need IF statement for if sub field has content
- Can not create fields in ACF with code
- Advanced Custom Fields – Check if multiple get_fields exist?
- ACF – Custom fields have dissappeared [closed]
- Error in Validate Field with ACF plugin in WordPress
- sort by date in Advanced Custom Field
- disable (read only) a field if within a custom post type name
- ACF if / else checkbox [closed]
- How to change the page title from functions.php
- Acf Pro repeater field returns null [closed]
- Insert Commas into ACF number field
- How I can check if get_theme_mod is in header or a template part
- WP Rest endpoint with custom post type and ACF Fields
- ACF Advanced Custom Fields | Help me grab the fields on my WooCommerce homepage [closed]
- Update post meta value as date difference between two fields
- My get_terms not working for custom fields
- How to share repeated fields across multiple pages?
- Remove headings option from Wysiwyg editor from ACF in a certain custom post type
- How to break a date from ACF?
- get all posts in custom post type by ACF field value
- Remove YoastSEO meta description from output/source [closed]
- Advanced Custom Fields changes get stuck in cache
- WordPress Date with ACF
- html element to separate php variable strings – ACF datepicker
- Get image data from advanced custom field [closed]
- Check for image with same filename but different extension
- Show only the future event (Advanced Custom Fields)
- Advanced Custom Fields if else issue
- If/Else Statement for Advanced Custom Fields
- How to get both image attachment ID and url
- Search and replace not working for ACF Images
- how make file upload field through custom field
- How Do I Use a ACF Custom Field To Add A Slider ID?
- Advanced Custom Fields oembed only outputs YouTube URL
- Hidden field in acf
- Importing ACF code in other page templates
- ACF Content with WPML not saving [closed]
- How do I ensure the social icons appear on all pages? [closed]
- Order get_terms by multiple meta_values
- Strip comma from last element in concatenated JSON string
- How can you query posts by advance custom field when the value is a serialized array? [closed]
- Check for duplicate custom field value before running wp_insert_post
- Query by radio button ACF
- How to change the background color of my header dynamically based on a Custom Posts types color value?
- Adding new parent item to admin bar
- Display category multi-select with Advanced Custom Felds
- Advanced Custom Fields Plugin: how to use a checkbox to allow a post to show up in desired “zone”?
- ACF: Grid based on field value
- Advanced Custom Field Textarea not Showing (ListingPro Theme)
- Fill up advanced custom field of a custom post type via API REST POST
- Two problems that are likely related to AJAX
- ACF – Eliminate unnecessary data and print
- Is there any way to bulk search-replace URLs that exist within ACF’s “Link” field type (serialized)?
- Get values from an advanced custom field
- Edit (advanced) customs fields on page template
- ACF Posts in Theme Options only returning when logged in? Bug?
- ACF – Adding PHP into Slick Slider Breaks the Slider
- Advanced Custom Fields frontend form submission
- Display of Custom Fields based on conditional if/and according to category/tag choice
- Comparing two dates (ACF and current time)
- Advanced Custom Fields Gallery and Flex Slider [reformuled]
- Advanced Custom Fields oEmbed video width and height
- Display ACF field(s) from widget in FE
- Convert number to date format within an array
- ACF not updating value correctly
- ACF Repeater and Sort
- Advanced Custom Fields, DatePicker – Check if Set
- How to access advance custom fields with post type in a for each loop
- ACF order relationship by date
- Pin to Top Functionality using orderby custom field then event date
- Acf Pro repeater field returns null when call inside foreach
- Relationship field search not retriving posts in admin
- advanced custom fields plugin last input field in new posts
- WordPress loop based on url sting
- Display “Today” Instead of Date for Pubslished Posts
- Updating custom fields with data from the database
- Advanced Custom Fields repeter field expiration
- Getting “Invalid argument supplied for foreach()” Warning
- WordPress/Timber/Twig – Trying to output checkbox values [closed]
- How to use WordPress to embed a SoundCloud download link?
- upgrading ACF (advanced custom fields) on an old site [closed]
- Updating post object via ACF breaks front-end
- Generate the post title from ACF fields
- Custom headings on WYSIWYGs per flexible content module in ACF
- Same ACF Relationship field for multiple Post Options sub-pages?
- Advanced Custom Fields – Issue with Slick Slider in ACF v6 Block
- Pending posts showing category until published