Support

Account

Forum Replies Created

  • – WordPress 5.4.2
    – ACF 5.8.12
    – PHP 7.3.15

    I’m trying to set a default value for a PostObject field. I can set the value just fine, but I can’t detect whether the field is filled out yet, because the acf/load_field hook doesn’t populate $field['value'] on this kind of field.

    function themename_default_tracking_campaign($field) {
    	if(empty($field['value'])) { // $field['value'] is always NULL, even if set
    		$field['value'] = ['3956']; // This line always blows away the set value
    	}
    	
    	return $field;
    }
    
    add_filter('acf/load_field/name=pardot_tracking_campaign', 'themename_default_tracking_campaign', 99999999);
    

    I think this is just a plain old bug? In any case, I’d love to know a workaround.

  • Yeah, I may work on that sometime. The Dash Docset Contribution Checklist makes it crystal clear that by submitting a docset, you’re signing up to maintain it indefinitely. I’m not ready for that kind of commitment. Plus, there are currently many manual steps in the build process that I haven’t scripted yet, and that’s a time commitment itself.

    I’ll be sure to post back here if I do any more with this, though!

  • I just made this for myself, hope it helps you guys until someone can commit to maintaining it indefinitely!

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