$args = apply_filters( 'wpmem_register_form_args', '', $tag, $id ); // Merge $args with defaults. $args = wp_parse_args( $args, $defaults ); // Get fields. $wpmem_fields = wpmem_fields( $tag ); // Fields to skip for user profile update. if ( 'edit' == $tag ) { $pass_arr = array( 'username', 'password', 'confirm_password', 'password_confirm' ); // Skips tos on user edit page, unless they haven't got a value for tos. if ( isset( $wpmem_fields['tos'] ) && ( $wpmem_fields['tos']['checked_value'] == get_user_meta( $userdata->ID, 'tos', true ) ) ) { $pass_arr[] = 'tos'; } foreach ( $pass_arr as $pass ) { unset( $wpmem_fields[ $pass ] ); } } /** * Filter the array of form fields. * * The form fields are stored in the WP options table as wpmembers_fields. This * filter can filter that array after the option is retreived before the fields * are parsed. This allows you to change the fields that may be used in the form * on the fly. * * @since 2.9.0 * @deprecated 3.1.7 Use wpmem_fields instead. * * @param array The array of form fields. * @param string $tag Toggle new registration or profile update. new|edit. */ $wpmem_fields = apply_filters( 'wpmem_register_fields_arr', $wpmem_fields, $tag ); $hidden_rows = array(); // Loop through the remaining fields. foreach ( $wpmem_fields as $meta_key => $field ) { // Start with a clean row. $val = ''; $label = ''; $input = ''; $field_before = ''; $field_after = ''; // If the field is set to display and we aren't skipping, construct the row. if ( $field['register'] ) { // Handle hidden fields if ( 'hidden' == $field['type'] ) { $do_row = false; $hidden_rows[ $meta_key ] = wpmem_form_field( array( 'name' => $meta_key, 'type' => $field['type'], 'value' => $field['value'], 'compare' => $valtochk, 'required' => $field['required'], ) ); } // Label for all but TOS and hidden fields. if ( 'tos' != $meta_key && 'hidden' != $field['type'] ) { $class = ( $field['type'] == 'password' || $field['type'] == 'email' || $field['type'] == 'url' ) ? 'text' : $field['type']; $label = wpmem_form_label( array( 'meta_key' => $meta_key, //( 'username' == $meta_key ) ? 'user_login' : $meta_key, 'label' => __( $field['label'], 'wp-members' ), 'type' => $field['type'], 'class' => $class, 'required' => $field['required'], 'req_mark' => $args['req_mark'] ) ); } // Gets the field value for edit profile. if ( ( 'edit' == $tag ) && ( '' == $wpmem->regchk ) ) { switch ( $meta_key ) { case( 'description' ): case( 'textarea' == $field['type'] ): $val = get_user_meta( $userdata->ID, $meta_key, 'true' ); // esc_textarea() is run when field is created. break; case 'user_email': case 'confirm_email': $val = sanitize_email( $userdata->user_email ); break; case 'user_url': $val = $userdata->user_url; // esc_url() is run when the field is created. break; case 'display_name': $val = sanitize_text_field( $userdata->display_name ); break; default: $val = sanitize_text_field( get_user_meta( $userdata->ID, $meta_key, 'true' ) ); break; } } else { if ( 'file' == $field['type'] ) { $val = ( isset( $_FILES[ $meta_key ]['name'] ) ) ? $_FILES[ $meta_key ]['name'] : '' ; } else { $val = ( isset( $_POST[ $meta_key ] ) ) ? $_POST[ $meta_key ] : ''; } } // Does the tos field. if ( 'tos' == $meta_key ) { $val = sanitize_text_field( wpmem_get( $meta_key, '' ) ); // Should be checked by default? and only if form hasn't been submitted. $val = ( ! $_POST && $field['checked_default'] ) ? $field['checked_value'] : $val; $input = wpmem_form_field( array( 'name' => $meta_key, 'type' => $field['type'], 'value' => $field['checked_value'], 'compare' => $val, 'required' => $field['required'], ) ); $input = ( $field['required'] ) ? $input . $args['req_mark'] : $input; // Determine if TOS is a WP page or not. $tos_content = stripslashes( get_option( 'wpmembers_tos' ) ); if ( has_shortcode( $tos_content, 'wpmem_tos' ) || has_shortcode( $tos_content, 'wp-members' ) ) { $tos_link_url = do_shortcode( $tos_content ); $tos_link_tag = ''; } else { $tos_link_url = WPMEM_DIR . "/wp-members-tos.php"; $tos_link_tag = ""; } /** * Filter the TOS link. * * @since 3.2.6 * * @param string $tos_link_tag * @param string $tos_link_url */ $tos_link_tag = apply_filters( 'wpmem_tos_link_tag', $tos_link_tag, $tos_link_url ); /** * Filter the TOS link text. * * @since 2.7.5 * * @param string The link text. * @param string $tag Toggle new registration or profile update. new|edit. */ $tos_link_text = apply_filters( 'wpmem_tos_link_txt', $wpmem->get_text( 'register_tos' ), $tag ); // If filtered value is not the default label, use that, otherwise use label. // @note: if default changes, this check must change. if ( __( 'Please indicate that you agree to the %s Terms of Service %s', 'wp-members' ) == $tos_link_text ) { if ( __( 'TOS', 'wp-members' ) != $field['label'] && __( 'Terms of Service', 'wp-members' ) != $field['label'] ) { $tos_link_text = $field['label']; } } // If tos string does not contain link identifiers (%s), wrap the whole string. if ( ! strpos( $tos_link_text, '%s' ) ) { $tos_link_text = '%s' . $tos_link_text . '%s'; } $input .= ' ' . sprintf( $tos_link_text, $tos_link_tag, '' ); // In previous versions, the div class would end up being the same as the row before. $field_before = ( $args['wrap_inputs'] ) ? '
' : ''; $field_after = ( $args['wrap_inputs'] ) ? '
' : ''; } elseif ( 'hidden' != $field['type'] ) { // For checkboxes. if ( 'checkbox' == $field['type'] ) { $valtochk = $val; $val = $field['checked_value']; // if it should it be checked by default (& only if form not submitted), then override above... if ( $field['checked_default'] && ( ! $_POST && $tag != 'edit' ) ) { $val = $valtochk = $field['checked_value']; } } // For dropdown select. if ( $field['type'] == 'select' || $field['type'] == 'radio' || $field['type'] == 'multiselect' || $field['type'] == 'multicheckbox' ) { $valtochk = $val; $val = $field['values']; } if ( ! isset( $valtochk ) ) { $valtochk = ''; } if ( 'edit' == $tag && ( 'file' == $field['type'] || 'image' == $field['type'] ) ) { $attachment_url = wp_get_attachment_url( $val ); $empty_file = '' . __( 'None' ) . ''; if ( 'file' == $field['type'] ) { $input = ( $attachment_url ) ? '' . get_the_title( $val ) . '' : $empty_file; } else { $input = ( $attachment_url ) ? '' : $empty_file; } $input.= '
' . $wpmem->get_text( 'profile_upload' ) . '
'; $input.= wpmem_form_field( array( 'name' => $meta_key, 'type' => $field['type'], 'value' => $val, 'compare' => $valtochk, ) ); } else { // For all other input types. $formfield_args = array( 'name' => $meta_key, // ( 'username' == $meta_key ) ? 'user_login' : $meta_key, 'type' => $field['type'], 'value' => $val, 'compare' => $valtochk, //'class' => ( $class ) ? $class : 'textbox', 'required' => $field['required'], 'placeholder' => ( isset( $field['placeholder'] ) ) ? $field['placeholder'] : '', 'pattern' => ( isset( $field['pattern'] ) ) ? $field['pattern'] : false, 'title' => ( isset( $field['title'] ) ) ? $field['title'] : false, 'min' => ( isset( $field['min'] ) ) ? $field['min'] : false, 'max' => ( isset( $field['max'] ) ) ? $field['max'] : false, 'rows' => ( isset( $field['rows'] ) ) ? $field['rows'] : false, 'cols' => ( isset( $field['cols'] ) ) ? $field['cols'] : false, ); if ( 'multicheckbox' == $field['type'] || 'multiselect' == $field['type'] ) { $formfield_args['delimiter'] = $field['delimiter']; } $input = wpmem_form_field( $formfield_args ); } // Determine input wrappers. $field_before = ( $args['wrap_inputs'] ) ? '
' : ''; $field_after = ( $args['wrap_inputs'] ) ? '
' : ''; } } // If the row is set to display, add the row to the form array. if ( $field['register'] && 'hidden' != $field['type'] ) { $values = ''; if ( 'multicheckbox' == $field['type'] || 'select' == $field['type'] || 'multiselect' == $field['type'] || 'radio' == $field['type'] ) { $values = $val; $val = $valtochk; } $rows[ $meta_key ] = array( 'meta' => $meta_key, 'type' => $field['type'], 'value' => $val, 'values' => $values, 'label_text' => __( $field['label'], 'wp-members' ), 'row_before' => $args['row_before'], 'label' => $label, 'field_before' => $field_before, 'field' => $input, 'field_after' => $field_after, 'row_after' => $args['row_after'], ); } } // If captcha is Really Simple CAPTCHA. if ( $wpmem->captcha == 2 && $tag != 'edit' ) { $row = wpmem_build_rs_captcha(); $rows['captcha'] = array( 'meta' => '', 'type' => 'text', 'value' => '', 'values' => '', 'label_text' => $row['label_text'], 'row_before' => $args['row_before'], 'label' => $row['label'], 'field_before' => ( $args['wrap_inputs'] ) ? '
' : '', 'field' => $row['field'], 'field_after' => ( $args['wrap_inputs'] ) ? '
' : '', 'row_after' => $args['row_after'], ); } /** * Filter the array of form rows. * * This filter receives an array of the main rows in the form, each array element being * an array of that particular row's pieces. This allows making changes to individual * parts of a row without needing to parse through a string of HTML. * * @since 2.9.0 * @since 3.0.9 Added $rows['label_text']. * @since 3.1.0 Added $rows['key']. * @since 3.1.6 Deprecated $rows['order']. * * @param array $rows { * An array containing the form rows. * * @type string order Field display order. (deprecated as of 3.1.6) * @type string meta Field meta tag (not used for display). * @type string type Input field type (not used for display). * @type string value Input field value (not used for display). * @type string values Possible field values (dropdown, multiple select/check, radio). * @type string label_text Raw text for the label (not used for display). * @type string row_before Opening wrapper tag around the row. * @type string label Label tag. * @type string field_before Opening wrapper tag before the input tag. * @type string field The field input tag. * @type string field_after Closing wrapper tag around the input tag. * @type string row_after Closing wrapper tag around the row. * } * @param string $tag Toggle new registration or profile update. new|edit. */ $rows = apply_filters( 'wpmem_register_form_rows', $rows, $tag ); // Make sure all keys are set just in case someone didn't return a proper array through the filter. // @todo Merge this with the next foreach loop so we only have to foreach one time. $row_keys = array( 'meta', 'type', 'value', 'values', 'label_text', 'row_before', 'label', 'field_before', 'field', 'field_after', 'row_after' ); foreach ( $rows as $meta_key => $row ) { foreach ( $row_keys as $check_key ) { $rows[ $meta_key ][ $check_key ] = ( isset( $rows[ $meta_key ][ $check_key ] ) ) ? $rows[ $meta_key ][ $check_key ] : ''; } } // Put the rows from the array into $form. $form = ''; $enctype = ''; foreach ( $rows as $row_item ) { // Check form to see if we need multipart enctype. $enctype = ( $row_item['type'] == 'file' || $row_item['type'] == 'image' ) ? "multipart/form-data" : $enctype; // Assemble row pieces. $row = ( $row_item['row_before'] != '' ) ? $row_item['row_before'] . $args['n'] . $row_item['label'] . $args['n'] : $row_item['label'] . $args['n']; $row .= ( $row_item['field_before'] != '' ) ? $row_item['field_before'] . $args['n'] . $args['t'] . $row_item['field'] . $args['n'] . $row_item['field_after'] . $args['n'] : $row_item['field'] . $args['n']; $row .= ( $row_item['row_after'] != '' ) ? $row_item['row_after'] . $args['n'] : ''; $form.= $row; } // Do recaptcha if enabled. if ( ( $wpmem->captcha == 1 || $wpmem->captcha == 3 ) && $tag != 'edit' ) { // don't show on edit page! // Get the captcha options. $wpmem_captcha = get_option( 'wpmembers_captcha' ); // Start with a clean row. $row = ''; $row = '
'; $row.= '
' . wpmem_inc_recaptcha( $wpmem_captcha['recaptcha'] ) . '
'; // Add the captcha row to the form. /** * Filter the HTML for the CAPTCHA row. * * @since 2.9.0 * * @param string The HTML for the entire row (includes HTML tags plus reCAPTCHA). * @param string $tag Toggle new registration or profile update. new|edit. */ $form.= apply_filters( 'wpmem_register_captcha_row', $args['row_before'] . $row . $args['row_after'], $tag ); } // Create hidden fields. $var = ( $tag == 'edit' ) ? 'update' : 'register'; $redirect_to = ( isset( $_REQUEST['redirect_to'] ) ) ? $_REQUEST['redirect_to'] : ( ( $redirect_to ) ? $redirect_to : get_permalink() ); $hidden_rows['_wpmem_a'] = ''; $hidden_rows['_wpmem_reg_page'] = ''; if ( $redirect_to != get_permalink() ) { $hidden_rows['_wpmem_redirect_to'] = ''; } /** * Filter the hidden form rows. * * @since 3.2.0 * * @param array $hidden_rows * @param string $tag */ $hidden_rows = apply_filters( 'wpmem_register_hidden_rows', $hidden_rows, $tag ); // Assemble hidden fields HTML. $hidden = ''; foreach ( $hidden_rows as $hidden_row ) { $hidden .= $hidden_row . $args['n']; } /** * Filter the hidden field HTML. * * @since 2.9.0 * * @param string $hidden The generated HTML of hidden fields. * @param string $tag Toggle new registration or profile update. new|edit. */ $hidden = apply_filters( 'wpmem_register_hidden_fields', $hidden, $tag ); // Add the hidden fields to the form. $form.= $hidden; // Create buttons and wrapper. $button_text = ( $tag == 'edit' ) ? $args['submit_update'] : $args['submit_register']; $button_html = array( 'reset' => ( $args['show_clear_form'] ) ? ' ' : '', 'submit' => '', ); $buttons = $button_html['reset'] . $args['n'] . $button_html['submit'] . $args['n']; /** * Filter the HTML for form buttons. * * The string passed through the filter includes the buttons, as well as the HTML wrapper elements. * * @since 2.9.0 * @since 3.2.6 Added $button_html parameter * * @param string $buttons The generated HTML of the form buttons. * @param string $tag Toggle new registration or profile update. new|edit. * @param array $button_html The individual button html. */ $buttons = apply_filters( 'wpmem_register_form_buttons', $buttons, $tag, $button_html ); // Add the buttons to the form. $form.= $args['buttons_before'] . $args['n'] . $buttons . $args['buttons_after'] . $args['n']; // Add the required field notation to the bottom of the form. $form.= $args['req_label_before'] . $args['req_label'] . $args['req_label_after']; // Apply the heading. /** * Filter the registration form heading. * * @since 2.8.2 * * @param string $str * @param string $tag Toggle new registration or profile update. new|edit. */ $heading = ( !$heading ) ? apply_filters( 'wpmem_register_heading', $wpmem->get_text( 'register_heading' ), $tag ) : $heading; $form = $args['heading_before'] . $heading . $args['heading_after'] . $args['n'] . $form; // Apply fieldset wrapper. $form = $args['fieldset_before'] . $args['n'] . $form . $args['n'] . $args['fieldset_after']; // Apply attribution if enabled. $form = $form . wpmem_inc_attribution(); // Apply nonce. Nonce uses $tag value of the form processor, NOT the form builder. $nonce = ( $tag == 'edit' ) ? 'update' : 'register'; $form = wp_nonce_field( 'wpmem_longform_nonce', '_wpmem_' . $nonce . '_nonce', true, false ) . $args['n'] . $form; // Apply form wrapper. $enctype = ( $enctype == 'multipart/form-data' ) ? ' enctype="multipart/form-data"' : ''; $form = '
' . $args['n'] . $form . $args['n'] . '
'; // Apply anchor. $form = '' . $args['n'] . $form; // Apply main div wrapper. $form = $args['main_div_before'] . $args['n'] . $form . $args['n'] . $args['main_div_after'] . $args['n']; // Apply wpmem_txt wrapper. $form = $args['txt_before'] . $form . $args['txt_after']; // Remove line breaks if enabled for easier filtering later. $form = ( $args['strip_breaks'] ) ? $this->strip_breaks( $form, $rows ) : $form; //str_replace( array( "\n", "\r", "\t" ), array( '','','' ), $form ) : $form; /** * Filter the generated HTML of the entire form. * * @since 2.7.4 * * @param string $form The HTML of the final generated form. * @param string $tag Toggle new registration or profile update. new|edit. * @param array $rows { * An array containing the form rows. * * @type string order Field display order. * @type string meta Field meta tag (not used for display). * @type string type Input field type (not used for display). * @type string value Input field value (not used for display). * @type string values The possible values for the field (dropdown, multiple select/checkbox, radio group). * @type string label_text Raw text for the label (not used for display). * @type string row_before Opening wrapper tag around the row. * @type string label Label tag. * @type string field_before Opening wrapper tag before the input tag. * @type string field The field input tag. * @type string field_after Closing wrapper tag around the input tag. * @type string row_after Closing wrapper tag around the row. * } * @param string $hidden The HTML string of hidden fields */ $form = apply_filters( 'wpmem_register_form', $form, $tag, $rows, $hidden ); /** * Filter before the form. * * This rarely used filter allows you to stick any string onto the front of * the generated form. * * @since 2.7.4 * * @param string $str The HTML to add before the form. Default null. * @param string $tag Toggle new registration or profile update. new|edit. */ $form = apply_filters( 'wpmem_register_form_before', '', $tag ) . $form; // Return the generated form. return $form; } // End register_form(). /** * Strip line breaks from form. * * Function removes line breaks and tabs. Checks for textarea fields * before stripping line breaks. * * @since 3.1.8 * * @param string $form * @param array $rows * @return string $form */ function strip_breaks( $form, $rows ) { foreach( $rows as $key => $row ) { if ( 'textarea' == $row['type'] ) { $textareas[ $key ] = $row['field']; } } $form = str_replace( array( "\n", "\r", "\t" ), array( '','','' ), $form ); if ( ! empty ( $textareas ) ) { foreach ( $textareas as $textarea ) { $stripped = str_replace( array( "\n", "\r", "\t" ), array( '','','' ), $textarea ); $form = str_replace( $stripped, $textarea, $form ); } } return $form; } /** * Login Dialog. * * Loads the login form for user login. * * @since 1.8 * @since 3.1.4 Global $wpmem_regchk no longer needed. * @since 3.2.0 Moved to forms class, renamed do_login_form(). * * @global object $post The WordPress Post object. * @global object $wpmem The WP_Members object. * @param string $page If the form is being displayed in place of blocked content. Default: page. * @param string $redirect_to Redirect URL. Default: null. * @param string $show If the form is being displayed in place of blocked content. Default: show. * @return string $str The generated html for the login form. */ function do_login_form( $page = "page", $redirect_to = null, $show = 'show' ) { global $post, $wpmem; $str = ''; if ( $page == "page" ) { if ( $wpmem->regchk != "success" ) { $dialogs = get_option( 'wpmembers_dialogs' ); // This shown above blocked content. $msg = $wpmem->get_text( 'restricted_msg' ); $msg = ( $dialogs['restricted_msg'] == $msg ) ? $msg : __( stripslashes( $dialogs['restricted_msg'] ), 'wp-members' ); $str = '

' . $msg . '

'; /** * Filter the post restricted message. * * @since 2.7.3 * @since 3.2.0 Added raw message string and HTML as separate params. * * @param string $str The post restricted message with HTML. * @param string $msg The raw message string. * @param string The 'before' HTML wrapper. * @param string The 'after' HTML wrapper. */ $str = apply_filters( 'wpmem_restricted_msg', $str, $msg, '

', '

' ); } } // Create the default inputs. $default_inputs = array( array( 'name' => $wpmem->get_text( 'login_username' ), 'type' => 'text', 'tag' => 'log', 'class' => 'username', 'div' => 'div_text', ), array( 'name' => $wpmem->get_text( 'login_password' ), 'type' => 'password', 'tag' => 'pwd', 'class' => 'password', 'div' => 'div_text', ), ); /** * Filter the array of login form fields. * * @since 2.9.0 * * @param array $default_inputs An array matching the elements used by default. */ $default_inputs = apply_filters( 'wpmem_inc_login_inputs', $default_inputs ); $defaults = array( 'heading' => $wpmem->get_text( 'login_heading' ), 'action' => 'login', 'button_text' => $wpmem->get_text( 'login_button' ), 'inputs' => $default_inputs, 'redirect_to' => $redirect_to, ); /** * Filter the arguments to override login form defaults. * * @since 2.9.0 * * @param array $args An array of arguments to use. Default null. */ $args = apply_filters( 'wpmem_inc_login_args', '' ); $arr = wp_parse_args( $args, $defaults ); $str = ( $show == 'show' ) ? $str . wpmem_login_form( $page, $arr ) : $str; return $str; } /** * Change Password Dialog. * * Loads the form for changing password. * * @since 2.0.0 * @since 3.2.0 Moved to forms class, renamed do_changepassword_form(). * * @global object $wpmem The WP_Members object. * @return string $str The generated html for the change password form. */ function do_changepassword_form() { global $wpmem; // create the default inputs $default_inputs = array( array( 'name' => $wpmem->get_text( 'pwdchg_password1' ), 'type' => 'password', 'tag' => 'pass1', 'class' => 'password', 'div' => 'div_text', ), array( 'name' => $wpmem->get_text( 'pwdchg_password2' ), 'type' => 'password', 'tag' => 'pass2', 'class' => 'password', 'div' => 'div_text', ), ); /** * Filter the array of change password form fields. * * @since 2.9.0 * * @param array $default_inputs An array matching the elements used by default. */ $default_inputs = apply_filters( 'wpmem_inc_changepassword_inputs', $default_inputs ); $defaults = array( 'heading' => $wpmem->get_text( 'pwdchg_heading' ), 'action' => 'pwdchange', 'button_text' => $wpmem->get_text( 'pwdchg_button' ), 'inputs' => $default_inputs, ); /** * Filter the arguments to override change password form defaults. * * @since 2.9.0 * * @param array $args An array of arguments to use. Default null. */ $args = apply_filters( 'wpmem_inc_changepassword_args', '' ); $arr = wp_parse_args( $args, $defaults ); $str = wpmem_login_form( 'page', $arr ); return $str; } /** * Reset Password Dialog. * * Loads the form for resetting password. * * @since 2.1.0 * @since 3.2.0 Moved to forms class, renamed do_resetpassword_form(). * * @global object $wpmem The WP_Members object. * @return string $str The generated html fo the reset password form. */ function do_resetpassword_form() { global $wpmem; // Create the default inputs. $default_inputs = array( array( 'name' => $wpmem->get_text( 'pwdreset_username' ), 'type' => 'text', 'tag' => 'user', 'class' => 'username', 'div' => 'div_text', ), array( 'name' => $wpmem->get_text( 'pwdreset_email' ), 'type' => 'text', 'tag' => 'email', 'class' => 'text', 'div' => 'div_text', ), ); /** * Filter the array of reset password form fields. * * @since 2.9.0 * * @param array $default_inputs An array matching the elements used by default. */ $default_inputs = apply_filters( 'wpmem_inc_resetpassword_inputs', $default_inputs ); $defaults = array( 'heading' => $wpmem->get_text( 'pwdreset_heading' ), 'action' => 'pwdreset', 'button_text' => $wpmem->get_text( 'pwdreset_button' ), 'inputs' => $default_inputs, ); /** * Filter the arguments to override reset password form defaults. * * @since 2.9.0 * * @param array $args An array of arguments to use. Default null. */ $args = apply_filters( 'wpmem_inc_resetpassword_args', '' ); $arr = wp_parse_args( $args, $defaults ); $str = wpmem_login_form( 'page', $arr ); return $str; } /** * Forgot Username Form. * * Loads the form for retrieving a username. * * @since 3.0.8 * @since 3.2.0 Moved to forms class, renamed do_forgotusername_form(). * * @global object $wpmem The WP_Members object class. * @return string $str The generated html for the forgot username form. */ function do_forgotusername_form() { global $wpmem; // create the default inputs $default_inputs = array( array( 'name' => $wpmem->get_text( 'username_email' ), 'type' => 'text', 'tag' => 'user_email', 'class' => 'username', 'div' => 'div_text', ), ); /** * Filter the array of forgot username form fields. * * @since 2.9.0 * * @param array $default_inputs An array matching the elements used by default. */ $default_inputs = apply_filters( 'wpmem_inc_forgotusername_inputs', $default_inputs ); $defaults = array( 'heading' => $wpmem->get_text( 'username_heading' ), 'action' => 'getusername', 'button_text' => $wpmem->get_text( 'username_button' ), 'inputs' => $default_inputs, ); /** * Filter the arguments to override change password form defaults. * * @since * * @param array $args An array of arguments to use. Default null. */ $args = apply_filters( 'wpmem_inc_forgotusername_args', '' ); $arr = wp_parse_args( $args, $defaults ); $str = wpmem_login_form( 'page', $arr ); return $str; } } // End of WP_Members_Forms class.