post_type !== Store::POST_TYPE || $form->post_status !== 'publish') { return current_user_can('edit_posts') ? '

' . esc_html__('Form not found or not published.', 'aumframe') . '

' : ''; } $fields = Store::fields($form_id); $settings = Store::settings($form_id); if (!$fields) { return current_user_can('edit_posts') ? '

' . esc_html__('This form has no fields yet.', 'aumframe') . '

' : ''; } wp_enqueue_style('aumframe-forms'); wp_enqueue_script('aumframe-forms'); $uid = 'aum-form-' . $form_id . '-' . wp_rand(1000, 9999); ob_start(); ?>
data-rest-nonce="">

', esc_attr($id), esc_attr($f['default'] ?? '') ); } $input_id = $uid . '-' . $id; $req = !empty($f['required']); $classes = 'aum-form-field aum-form-field--' . sanitize_html_class($type) . ' is-' . (($f['width'] ?? 'full') === 'half' ? 'half' : 'full'); ob_start(); ?>

%s', esc_attr($input_id), esc_attr($id), $ph, $req, esc_textarea($f['default'] ?? '') ); case 'select': { /* * `?:` still reads the key — with no placeholder set, it throws "Undefined array key", * and with WP_DEBUG on that prints onto the front-end page. * Everywhere else in this file uses `?? ''`; this was the one place that missed it. * (Found on 2026-08-22: a string of PHP warnings printed on the contact page's form. * placeholder is an optional key and leaving it out is entirely normal.) */ $opts = ''; foreach (Fields::resolve_options($f) as $o) { $opts .= sprintf('', esc_attr($o['value']), esc_html($o['label'])); } return sprintf('', esc_attr($input_id), esc_attr($id), $req, $opts); } case 'radio': case 'checkbox': { $out = '
'; $i = 0; $name = $type === 'checkbox' ? $id . '[]' : $id; foreach (Fields::resolve_options($f) as $o) { $cid = $input_id . '-' . (++$i); $out .= sprintf( '', esc_attr($cid), esc_attr($type), esc_attr($cid), esc_attr($name), esc_attr($o['value']), esc_html($o['label']) ); } return $out . '
'; } case 'consent': return sprintf( '', esc_attr($input_id), esc_attr($input_id), esc_attr($id), $req, wp_kses($f['label'] ?? '', Fields::consent_label_html()) ); default: { $html_type = in_array($type, ['email', 'tel', 'number'], true) ? $type : 'text'; /* * autocomplete is what saves the user work, especially on a phone. * Emit the hints browsers understand per field type rather than expecting people to type every * field by hand. */ $ac = ['email' => 'email', 'tel' => 'tel'][$type] ?? 'on'; return sprintf( '', esc_attr($html_type), esc_attr($input_id), esc_attr($id), esc_attr($f['default'] ?? ''), esc_attr($ac), $ph, $req ); } } } }