Support

Account

Home Forums Backend Issues (wp-admin) Get Custom Post Type ID Reply To: Get Custom Post Type ID

  • I was able to piece together some code to get this to work. Thank you for leading me in the right direction. Here is the full code if anyone else is interested.

    add_filter('acf/load_field/name=custom_post_type_id', function($field) {
    	$id = get_the_ID();
    	$field['default_value'] = __($id, 'txtdomain');
    	return $field;
    });