WP-Members插件将类添加到标签/输入

According to this guide I can add classes to inputs or labels, however I'm unsure how to get it work. The example make me feel like the code below should work, but clearly it's wrong.

add_filter( 'wpmem_register_form_rows', 'my_register_form_rows_filter', 10, 2 );

function my_register_form_rows_filter( $rows, $toggle )
{
    zip => array (
        'field_before' => '<div class="div_text new_class">'
         )

return $rows;
}

If i'm not wrong the 'field_before' add a wrapper to the input, so you need to use insted

 'field' => '<input name="option_name" type="text" id="option_name" value="" class="YOURCLASS" />'

EDIT:

you need to close your div

'field_before' => '<div class="div_text">'
'field_after' => '</div>'

The question and the previous answer are close, but not correct. The correct way to use the wpmem_register_form_rows in this way would as follows:

add_filter( 'wpmem_register_form_rows', 'my_register_form_rows_filter', 10, 2 );
function my_register_form_rows_filter( $rows, $toggle ) {
    $rows['zip']['field_before'] = '<div class="div_text new_class">';
    return $rows;
}

Addressing the previous answer about closing the div, you actually don't have to. The closing div will already be there - all you are doing here is changing, not adding, the wrapper for a specific field (the "zip" field, in this case).