I think the only thing missing here is an update_callback
in the call to register_rest_field
.
register_rest_field( 'note', 'noteLink', array(
'get_callback' => function(){ return get_field('page_link'); },
'update_callback' => function( $value, $post ){
update_field('field_619dacfd37924', $value, $post->ID );
}
));
An important part of that according to ACF docs is using the field key to update the value when there is no value yet set.
The field’s key should be used when saving a new value to a post (when no value exists). This helps ACF create the correct ‘reference’ between the value and the field’s settings.
The field’s key can be found while editing the field group though you may need turn on the option to show “Field Keys” within “Screen Options” if you haven’t done so already. Then look for the “Key” column in the table of the fields. Here’s what I see.
On a separate note, when registering the post type, the supports
property can be cleaned up to just:
'supports' => array('title', 'editor'),
Having ‘advanced-custom-fields’ in there doesn’t do anything.