';
}
/**
* Closes a card.
*
* @return void
*/
public static function card_close() {
echo '
';
}
/**
* Opens a settings row: label and help on one side, the control on the other.
*
* @param string $label Label text.
* @param string $help Help text.
* @param string $target Id of the control.
* @param array $attrs Extra attributes for the row, for example data-dep.
* @return void
*/
public static function row_open( $label, $help, $target = '', array $attrs = array() ) {
$attrs['class'] = 'aslo-row' . ( isset( $attrs['class'] ) ? ' ' . $attrs['class'] : '' );
echo '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in attributes().
echo '';
if ( '' !== $help ) {
echo '
' . esc_html( $help ) . '
';
}
echo '
';
}
/**
* Closes a settings row.
*
* @return void
*/
public static function row_close() {
echo '
';
}
/**
* Prints an on/off switch. A hidden zero is sent first so unchecked boxes are saved.
*
* @param string $name Input name.
* @param bool $checked Current state.
* @param string $id Element id.
* @param string $text Optional text beside the switch.
* @param string $form Id of the form the switch belongs to, when it sits outside it.
* @return void
*/
public static function switch_input( $name, $checked, $id, $text = '', $form = '' ) {
$form_attr = '' !== $form ? ' form="' . esc_attr( $form ) . '"' : '';
echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above.
echo '';
}
/**
* Prints a group of radio buttons styled as one segmented control.
*
* @param string $name Input name.
* @param string[] $choices Value to label.
* @param string $value Current value.
* @param string $id Base id.
* @return void
*/
public static function segmented( $name, array $choices, $value, $id ) {
echo '