Membership Plugin
Membership Plugin
The membership plugin is where it all starts. The plugin handles authentication, initializing other HJI plugins, providing an API for other plugins to use when adding functionality, extending the codebase with third-party libraries and more.
Plugin Loading
Membership handles plugin loading and authentication with the Home Junction system. It will load during the typical WP loading process, but all other HJI plugins hook into Membership so that Membership can handle plugin updates, authentication, API calls with Slipstream and more.
Plugin Loading Hook
Plugins hook into Membership against the hji_membership_register_plugin
action. The action callback should accept a $plugins
array and the plugin that is activating itself against Membership will append to this array. The each plugin should append an array to the $plugins
array which contains 2 key/value pairs as illustrated below.
function registerPlugin($plugins) { array_push($plugins, [ 'file' => $main_plugin_file_path, 'callback' => 'some_call_back_method', ]); return $plugins; } add_filter('hji_membership_register_plugin', 'registerPlugin');
The file
key should point to a file reference to the main plugin file loaded by WP. The callback
key should point to a callback method which should be loaded when Membership authenticates. In the above example the callback method of some_call_back_method
will load the main functionality of our plugin when Membership has authenticated against the Home Junction Membership API.
Javascript API
Membership utilizes RequireJS for asynchronous, on-demand module loading. To >learn more about the RequireJS API visit our guide.
Third Party Libraries
Membership loads a series of third-party libraries and packages out of the box for other plugins and themes to use in front-end development and admin screens. Below is a list of these packages and additional information about their integration.
Third-Party Library | Language | Documentation |
---|---|---|
CMB2 - Custom Meta Boxes and Fields | PHP | ... |
Dice Dependency Injection | PHP | ... |
Timber (Twig for WordPress) | PHP | ... |
colorbox | JS | https://github.com/jackmoore/colorbox |
bxslider | JS | https://github.com/stevenwanderski/bxslider-3 |
selectize | JS | ... |
Third Party Plugin Integration
Membership and other HJI plugins integrate with the following 3rd party plugins out of the box. All of the websites we build for clients utilize these plugins in our standard process.
Gravity Forms
We use Gravity Forms for all our of our contact and lead conversion forms.
WordPress SEO (Yoast SEO)
All of the websites we