• Resolved markdimi

    (@markdimi)


    I have created a CPT which has a Yes/No field. I am building a custom page where users can change this Yes/No field in bulk. I am trying to pass values to this field but nothing sticks. I have tried values 0 and 1 as integers and strings, also the strings “Yes” and “No”.

    I am saving the posts like this:

    $pod = pods( 'pod_cpt', $post_id );
    
    $data = array(
        'item_sold' => $boolean,
        'row' => $row,
    );
    $pod->save( $data );

    The rowfield is being saved since it’s a text field, however the item_soldfield is not.

    Any ideas?

Viewing 1 replies (of 1 total)
  • Thread Starter markdimi

    (@markdimi)

    Turns out I had an error in the name of the variable. Passing 1 or 0 as strings works as a charm.

Viewing 1 replies (of 1 total)
  • The topic ‘Save a pod with a yes/no field’ is closed to new replies.