Support

Account

Home Forums Backend Issues (wp-admin) Conditionally registering field on acf/update_value Reply To: Conditionally registering field on acf/update_value

  • Thanks for your suggestion John, but that would require me to know all possible field names in advance (so I could hide/show the correct one conditionally). There are infinite possibilities in my case.

    What about using acf_update_field to write the field to the database? From includes/api-field.php:

    /*
    *  acf_update_field
    *
    *  This function will update a field into the DB.
    *  The returned field will always contain an ID
    *
    *  @type	function
    *  @date	1/10/13
    *  @since	5.0.0
    *
    *  @param	$field (array)
    *  @return	$field (array)
    */
    
    function acf_update_field( $field = false, $specific = false )

    I could construct a field object and call this function perhaps?