Replacing create_function in validation loop

I have a validation loop in a class in an outdated but functional plugin that I need to keep (for now). It uses create_function twice. if( is_array($s) ) { $c = count($s); $a = 0; while( $a < $c ) { if( isset($s[$a]['validate_callback']) ) { $this->create_function[] = $s[$a]['id']; $s[$a]['validate_callback'] = ''; $file= addslashes(WC_XSI_SETTINGS . 'validate-' . $s[$a]['id'] . '.php'); $s[$a]['validate_callback'] = create_function('$fields', 'do_action("wc_xsi_settings_validate",$fields); do_action("wc_xsi_settings_validate_' . $s[$a]['id'] . '",$fields);'); } $a++; } } There were several more instances - mainly in widget declations - that I have replaced, but this one stumped me. Is there a way to perform this validation without it? I'll be honest I haven't a notion how to start and really would appreciate a heads up.

Comment (0)

You’ll be in good company