I was trying to find some documentation on this too – I couldn’t. So then I found the error in the code. The additional parameters aren’t being passed.
In scripts.js I’ve added the code that seems to get this working. Hopefully this helps others get the the solution quicker – as well as it added into a future update.
Please note: I’ve only added 2 lines – this is mostly for reference.
// field type post
// popup a dialog where the user can choose the post to attach
$(document).on("click", "a.simple-fields-metabox-field-post-select", function(e) {
e.preventDefault();
var a = $(this);
// get post types to show
var div = a.closest(".simple-fields-metabox-field");
var enabled_post_types = div.find("input[name='simple-fields-metabox-field-post-enabled-post-types']").val();
var additional_args = div.find('input[name="additional_arguments"]').val();
$("div.simple-fields-meta-box-field-group-field-type-post-dialog").data("originLink", this).dialog({
width: 480,
height: 'auto',
modal: true,
dialogClass: 'wp-dialog',
zIndex: 300000,
open: function(event, ui) {
var originLink = $($(this).data("originLink"));
arr_enabled_post_types = enabled_post_types.split(",");
$(this).text("Loading...").load(ajaxurl, {
"action": "simple_fields_field_type_post_dialog_load",
"arr_enabled_post_types": arr_enabled_post_types,
"additional_arguments" : additional_args
});
}
});
});