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' );