Support

Account

Home Forums Add-ons Options Page Options Page Fields Update

Helping

Options Page Fields Update

  • Hello,

    I’m trying to update saved value of the “Page Link” field into the options page(purchased add-on) however i’m not sure what i should use, at the moment i’m trying to make the update through the page name but it’s not working, this is the code i’m using into functions.php

    
    $field_name = "dashboard_page";
    $value = "new page name";
    update_field( $field_name, $value );
    

    However the code above doesn’t work, am i missing something?

  • Hi @alexgold05

    You are missing the $post_id parameter from the update_field function:
    http://www.advancedcustomfields.com/resources/functions/update_field/

    Please change your code to:

    
    $field_name = "dashboard_page";
    $value = "new page name";
    update_field( $field_name, $value, 'option' );
    
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Options Page Fields Update’ is closed to new replies.