| ' . esc_html( $label ) . ' | | ';
}
}
if ( ! function_exists( 'ppl_afw_setting_number' ) ) {
/**
* Renders a number settings row.
*
* @param string $key Setting key.
* @param string $label Row label.
* @param array $s Settings.
* @param array $attrs step/min/max/suffix/description.
*/
function ppl_afw_setting_number( $key, $label, $s, $attrs = array() ) {
$id = 'ppl-' . str_replace( '_', '-', $key );
echo ' | ';
echo ' ' . esc_html( $attrs['suffix'] ?? '' );
if ( ! empty( $attrs['description'] ) ) {
echo ' ' . esc_html( $attrs['description'] ) . ' ';
}
echo ' |
';
}
}
if ( ! function_exists( 'ppl_afw_setting_text' ) ) {
/**
* Renders a text settings row.
*
* @param string $key Setting key.
* @param string $label Row label.
* @param array $s Settings.
* @param string $description Description.
*/
function ppl_afw_setting_text( $key, $label, $s, $description = '' ) {
$id = 'ppl-' . str_replace( '_', '-', $key );
$value = $s[ $key ];
echo ' | ';
echo '';
if ( $description ) {
echo ' ' . esc_html( $description ) . ' ';
}
echo ' |
';
}
}
if ( ! function_exists( 'ppl_afw_setting_select' ) ) {
/**
* Renders a select settings row.
*
* @param string $key Setting key.
* @param string $label Row label.
* @param array $options value => label.
* @param array $s Settings.
*/
function ppl_afw_setting_select( $key, $label, $options, $s ) {
$id = 'ppl-' . str_replace( '_', '-', $key );
echo ' | |
';
}
}
if ( ! function_exists( 'ppl_afw_field_builder_row' ) ) {
/**
* Renders one registration field builder row.
*
* @param array $field key, label, type, required.
*/
function ppl_afw_field_builder_row( $field ) {
$types = array(
'text' => __( 'Text', 'affireo-affiliates-for-woocommerce' ),
'textarea' => __( 'Paragraph', 'affireo-affiliates-for-woocommerce' ),
'url' => __( 'Website URL', 'affireo-affiliates-for-woocommerce' ),
'email' => __( 'Email', 'affireo-affiliates-for-woocommerce' ),
'tel' => __( 'Phone', 'affireo-affiliates-for-woocommerce' ),
'number' => __( 'Number', 'affireo-affiliates-for-woocommerce' ),
);
$required = ! empty( $field['required'] );
?>
$field );
ppl_afw_field_builder_row( $field );
}
?>
'text' ) ); ?>