Linked profile custom field

Nice work.

There’s a WYSIWYG editor button for a script block.

I expanded the code to read it, but it seems like parts were stripped from your copy/paste, specifically any HTML tags. Some examples below; I’ll leave it to you to share the full code.

// nothing in REGEX
preg_match('//U', $buffer, $match, PREG_UNMATCHED_AS_NULL); $current = empty($match) ? -1 : $match[1];
// should be <option/> I think
$select_options .= '' . $name . '';
// should be <select/> I think
$regex_replace = '' . $select_options . '';

It would be nice to use the gid, both to avoid group name changes and skip a regex/parse. Likely not a major concern in this specific case given we’re editing the group itself, except perhaps if the name and coordinator are changed in the same edit/save?

Still, if you have the gid, perhaps a $_LW->read() with a filter argument would work?

// untested
$group_id = $_LW->_GET['id'];
$data_type = 'profiles';
$args = [
	'tid' => 2,
	'filter' => 'gid|equals|'.$group_id
];
$people = $_LW->read($data_type, $args);