I'm a newbie and I have not been able to find an answer to my question.
I have installed the Sidebar Login plugin and I'm trying to change the form labels, specifically,the login button label.
I understand that I need to add a filter to my functions.php file in the child theme in order to modify the following piece of code:

$login_form_args = apply_filters( 'sidebar_login_widget_form_args', array(
            'echo'              => true,
            'redirect'          => esc_url( apply_filters( 'sidebar_login_widget_login_redirect', $redirect ) ),
            'label_username'    => __( 'Username', 'sidebar_login' ),
            'label_password'    => __( 'Password', 'sidebar_login' ),
            'label_remember'    => __( 'Remember Me', 'sidebar_login' ),
            'label_log_in'      => __( 'Login →', 'sidebar_login' ),
            'remember'          => true,
            'value_remember'    => true
        ) );

        wp_login_form( $login_form_args );

The filter to change any of the arrays is: sidebar_login_widget_form_args

I have spent an entire day trying to figure out how to properly code the filter without any success. I would greatly appreciate anyone's help.

1 Answer 1


In your funtions file, you need to create your function, name it as you like:

function my_changein_args ($my_form_args) {
  return array(
    'echo'           => true,
    'redirect'       => esc_url( apply_filters( 'sidebar_login_widget_login_redirect', $redirect ) ),
    'label_username' => __( 'Yourusernamelabel', 'sidebar-login' ),
    'label_password' => __( 'Yourpasswordlabel', 'sidebar-login' ),
    'label_remember' => __( 'Yourrememberlabel', 'sidebar-login' ),
    'label_log_in'   => __( 'Yourloginlabel', 'sidebar-login' ),
    'remember'       => $show_rememberme,
    'value_remember' => true
add_filter( 'sidebar_login_widget_form_args', 'my_changein_args' ); 

Don't forget to open and close PHP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.