• Hey,

    I am using the acf/load_field field for an auto increment function.

    This is working okay.

    But how can I avoid to load this function when editing an old post?

    At the moment it overwrites the existing value when opening the editor mask.

    function fill_field( $field ) {
        $jobnr=get_option('pro_max-job-nummer')+1;
        $field['value']=$jobnr; 
        return $field;
    }
    add_filter('acf/prepare_field/name=job-nummer', 'fill_field');
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘acf/load_field only for NEW post’ is closed to new replies.