%2$s
%4$s
' . esc_html($o['text']) . '
' : '', $body ); } /** * A setting row: the label, the control, one line of help, and optionally more behind * "Learn more". * * @param array{for?: string, help?: string, more?: string, link?: array{0: string, 1: string}, class?: string, attrs?: string} $o more: escaped HTML; link: [label, url], opens in a new tab; attrs: escaped attributes. */ public static function row(string $label, string $control, array $o = []): string { $labelHtml = isset($o['for']) ? '' : '' . esc_html($label) . ''; $link = isset($o['link']) ? ' ' . self::external($o['link'][0], $o['link'][1]) : ''; $help = (isset($o['help']) && $o['help'] !== '') || $link !== '' ? '' . esc_html($o['help'] ?? '') . $link . '
' : ''; $more = isset($o['more']) && $o['more'] !== '' ? self::more(__('Learn more', 'aipcf-ai-provider-for-cloudflare'), $o['more']) : ''; $class = isset($o['class']) && $o['class'] !== '' ? ' ' . esc_attr($o['class']) : ''; return sprintf('| ' . esc_html($h) . ' | '; } $out .= '|
|---|---|
| ' . $cell . ' | ' : '' . $cell . ' | '; } $out .= '
| ' . $cell . ' | ' : '' . $cell . ' | '; } $out .= '
' . esc_html($text) . '
'; } /** * Actions: buttons first (at most one primary), then links, separated. * * @param list%2$s
', sanitize_html_class($type), esc_html($text), $role); } /** * A status pill: On, Off, Offline today, Needs you. * * @param string $state '', 'ok', 'warn' or 'bad'. */ public static function pill(string $label, string $state = ''): string { return sprintf('%2$s', $state !== '' ? ' is-' . sanitize_html_class($state) : '', esc_html($label)); } /** * Details behind a disclosure ("Learn more", "Which models"). */ public static function more(string $summary, string $html): string { return '