Home Forums General Issues getting field value – acf/save_post


getting field value – acf/save_post

  • Hi,

    I m using acf/save_post to get a field value in the purpose to actualise some other DB table.
    My field name is ‘businesstemple_settings__post_shorturl_podcast_number’, but it is named ‘field_609103a4249a4’ in $_POST.

    3 questions
    – why the field is named in that way instead of my defined name in ACF builder ?
    – where i can get this “underground” id/name ‘field_609103a4249a4’ in ACF ?
    – is this “underground” id/name is a constant id or changing id ?

    I’m using a code like that :

    add_action(‘acf/save_post’, ‘my_acf_save_post’, 5);
    function my_acf_save_post( $post_id ) {

    // Get previous values.
    $prev_values = get_fields( $post_id );

    // Get submitted values.
    $values = $_POST[‘acf’];

    // Check if a specific value was updated.
    if( isset($_POST[‘acf’][‘field_abc123’]) ) {
    // Do something.

    and if i do a var_dump of $_POST :

    $_POST = array (
    ‘acf’ =>
    array (
    ‘field_609103a4249a4’ => ‘manon’,
    ‘field_609103fe249a5’ => ”,
    ‘field_60910458249a6’ => ‘Article’,
    ‘field_60910498249a7’ => ‘’,
    ‘field_609104cb249a8’ => ”,
    ‘field_60a52f48dab06’ => ‘0’,
    ‘field_60831eabe7ada’ => ”,

    Thanks for helping

  • field_609103a4249a4 is the unique field key for the field. Because the field name can be changed this is what ACF uses to identify the field. This value never changes. You can see these field keys when editing a field group. Top of the page => Page Options, check the box for field keys.

    When using acf/save_post if you use a priority of > 10 for your action then you can get the values from the DB by using ACF functions rather than trying to look in $_POST.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.