Support

Account

Home Forums ACF PRO Populate repeater in CPT from repeater in Options page Reply To: Populate repeater in CPT from repeater in Options page

  • you can disable the disable editing of some fields by making them read only using and acf/load_value filter. When dealing with repeater sub fields you should always use the field key.

    
    add_filter('acf/load_field/key=field_56e870552a8c1', 'make_field_readonly');
    function make_field_readonly($field) {
      // do not do this if it's the options page
      // if you're using the same field group
      global $post;
      if ((!$post) || !isset($post->ID) || get_post_type($post->ID) != 'your-post-type') {
        return $field;
      }
      $field['readonly'] = 1;
      return $field;
    }