Support

Account

Forum Replies Created

  • Hi James

    Thank you very much. Your code worked for me very well.but it could not handle repeater fields. please help me to fix your code for repeaters.

  • Hi
    Thanks for your response

    I’d like to know which fields have been changed since last revision.

  • Hi
    You can use this code :

    function disable_message_load_field( $field ) {
    $field[‘readonly’] = 1;
    return $field;
    }
    add_filter(‘acf/load_field/name=sub_field_1’, ‘disable_message_load_field’);
    add_filter(‘acf/load_field/name=sub_field_2’, ‘disable_message_load_field’);

    to make your field read only. please note that disabled field are not saved and it is better to use radonly to keep your data.

    for inserting current user info in sub field you can use this code:

    global $current_user;
    get_currentuserinfo();
    $message_sender = $current_user->display_name;
    update_field(‘message_sender ‘, $message_sender, $post_id);

  • Dear John
    if i make fields readonly, i cant put data in theme.i need my user send information via this fields but couldn’t edit theme after submission.

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