PHP: Flow of data: WordPress – MagicMembers Plugin

July 3rd, 2013 by Richy B. Leave a reply »

I hope this post comes in handy to any one else which has to support/deal with the MagicMembers plugin for WordPress.

The [user_register\ calls mgm_content_hooks.php “function mgm_shortcode_parse” which then calls mgm_user_register_form which is in mgm_form_functions.

If fetches the main registration fields using:
$register_fields = mgm_get_config(‘default_register_fields’,array());
[fields such as username, email address]
and the custom ones using:
$cf_register_page = mgm_get_class(‘member_custom_fields’)->get_fields_where(array(‘display’=>array(‘on_register’=>true)));
[fields such as subscription_options, password, and all others]

However, it then calls the filter mgm_register_form via the line:
$form_html .= apply_filters(‘mgm_register_form’, $form_html);
which calls, via mgm_user_hooks.php, the function mgm_wp_register_form_additional which is defined in core/hooks/mgm_user_hooks.php .

Using the templates it gets from two other filters (mgm_generate_register_form_template and mgm_register_form_template), it then tries to build the template using the filter mgm_generate_register_form_html. This filter (again defined in core/hooks/mgm_user_hooks.php) calls the function mgm_generate_register_form_html (again defined in mgm_user_hooks.php) and then the mgm_register_form_additional_html filter – which isn’t defined.

So, in short:

shortcode [user_register\ -> function mgm_shortcode_parse -> function mgm_user_register_form -> filter mgm_register_form -> function mgm_user_hooks -> function mgm_wp_register_form_additional -> filter mgm_generate_register_form_html -> function mgm_generate_register_form_html -> filter mgm_register_form_additional_html

This post is over 6 months old.

This means that, despite my best intentions, it may no longer be accurate.

This blog holds over 12 years of archived content - during that time, I may have changed my opinion of something, technology will have advanced (and old "best standards" may no longer be the case), my technology "know how" has improved etc etc - it would probably take me a considerable amount of time to update all the archival entries: and defeat the point of keeping them anyway.

Please take these posts for what they are: a brief look into my past, my history, my journey and "caveat emptor".

Comments are closed.

gamy-dance
%d bloggers like this: