I'm trying to interpret this action hook name:


What is meaning of BEFORE and AFTER in this hook name? Do the underscores mean anything?

It seems that the hook name contains two function names, sc_authnet_form and shortcode_atts, that are connected by BEFORE and AFTER words.


ws_plugin__s2member_pro_before_sc_authnet_form_after_shortcode_atts is do_action() function and this one display position of function execution.

U have need change argument before sc_authnet_form and After shortcode_atts in filter function.


The ws_plugin__s2member_pro_before_sc_authnet_form_after_shortcode_atts hook is one hook and not a combination of hooks. This hook is probably from the s2member plugin from what I can determine from the hook name.

Frankly, I do not know the plugin, also, third party plugins are still considered off topic here, so I cannot give a specific answer, but in short, reading the extra loooonnngggg hook name, this hook is in between two actions/filters/functions/custom code. Most probably this will be before the sc_authnet_form hook/filter/function but after the shortcode_atts function.

Although the hook name is really long, it is very descriptive and gives you a very good idea where the hook is used. This is just very good coding practice. Function, class, variable, filter and action names should always be descriptive. It just makes your code easier to follow and gives one a good idea what a function etc should be doing


The underscores are basic PHP. Simply stated, all words in function/filter/action/variable names should be separated by underscores.


For clarity, the before and after words don't have any special meaning at all in PHP. They are purely used as descriptive words, as I stated previously, and as example, a hook called before_something is in al probablity used before a function/another hook called something. It is as easy as that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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