Support » Plugin: WP-Members Membership Plugin » Issue filed for wpmem_login_failed_args

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    Hi Josh,

    Your filter function should only return values that are changed and those are merged into the defaults.

    However the documentation needs to be updated to correctly reflect that no param is passed in.

    For future reference, trac notifies of submissions, you don’t need to post here that you posted on trac.

    Thanks for responding, Chad, and for the great plugin.

    Sorry for the erroneous ticket, and yes, the documentation was what was confusing me me. Having worked with several similar filters for this plugin (e.g., wpmem_login_form_args), I’ve been including $args as an argument, and assumed I was modifying and returning that array. I think I need to check back through my code to be sure I’m using all the _args filters correctly. This was the first case in which I was getting an error from passing that parameter.

    For example, wpmem_login_form_args documentation says it’s taking in $args and returning a modified array. Now I think this is also wrong. Is there (or should there be) a standard API for all of these types of filters?

    EDIT: Now I went back and put a breakpoint in wpmem_msg_dialog_arr. In this case, $args (listed as required) is definitely being passed in. I see that this method is suffixed with _arr, not _args, so that might be my confusion. The example, in this case, is clear that I need to assign new values to specific array members, and not create and return a new array.

    Also, note, in your revised documentation for wpmem_login_failed_args, you now have a “required” return value.

    
    Return
    $args
    (array) (required) An array of arguments that are to override form $defaults.
    

    Oh, and thanks for the tip on trac. Your plugin was not available in the list of plugins to attach to the ticket, so I wasn’t clear on how the association was even made, or if you’d get alerted.

    Regards,

    Josh

    • This reply was modified 6 months, 1 week ago by  Josh68.
    Plugin Author Chad Butler

    (@cbutlerjr)

    Some of the documentation reflects that the defaults are passed, but that will need to be updated as they are not.

    At one point I had wanted to change that but put it aside because we were already too deep into the current standard. Were I going back to do it all over again, I wouldn’t do it the same way, but changing it now would affect too many users (many of whom do not read changelogs and would end up with broken customizations if it were changed).

    Note however that “_args” and “_arr” filters are not the same. Anytime you see “_args” on one of my filters, it is for some default settings. But if it’s “_arr” it is an array of something (not necessarily settings/defaults).

    Also, note, in your revised documentation for wpmem_login_failed_args, you now have a “required” return value.

    That probably should be changed to “optional” in this case.

    Much of the filter documentation has been in a state of change due to some formatting changes on the site, so I’ll add it to the list of things to address.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issue filed for wpmem_login_failed_args’ is closed to new replies.