$meta ) { $key = sanitize_key( $key ); $label = isset( $meta['label'] ) ? $meta['label'] : ucfirst( $key ); $desc = isset( $meta['desc'] ) ? $meta['desc'] : ''; $logo_html = isset( $meta['logo'] ) ? $meta['logo'] : ''; $field_id = $id_base . '_' . $key; $is_checked = in_array( $key, $enabled, true ) ? 'checked' : ''; // One row = logo + title on the left, switch on the right, desc underneath. $rows_html .= sprintf( '
%7$s', $logo_html, // %1$s logo HTML (already escaped/controlled below) esc_attr( $field_id ), // %2$s input id esc_html( $label ), // %3$s provider title esc_attr( $id_base ), // %4$s name base (array) esc_attr( $key ), // %5$s value $is_checked, // %6$s checked attr $desc ? '

' . esc_html( $desc ) . '

' : '' ); } // Wrap in a section block with an overall label/desc if provided. $section_label = isset( $args['field']['label'] ) ? $args['field']['label'] : ''; $section_desc = isset( $args['field']['desc'] ) ? $args['field']['desc'] : ''; printf( '
%2$s
%3$s
', esc_html( $section_label ), wp_kses_post( $rows_html ), $section_desc ? '

' . esc_html( $section_desc ) . '

' : '' );