How to use
Last updated
Was this helpful?
Last updated
Was this helpful?
The module is available for free installation through . Assuming you've added the Bootstrapper module to your project using , your plugin's main file should look something like this:
The example above is very rudimentary. You can check for a more complete example.
There is no point for the Bootstrapper module to run on all PHP versions back to 5.3 if your own bootstrap file doesn't. For example, import of functions from another namespace is only supported since PHP5.6! For brevity, that has not been included in the code example above, but it is shown in the example plugin's bootstrap file.
The outputted admin notice can be customized using the following actions:
dws_wp_framework_requirements_error_before
-- called before any HTML output of the notice
dws_wp_framework_requirements_error_start
-- called right after the opening <div>
dws_wp_framework_requirements_error_list_before
-- called right after the opening <ul>
dws_wp_framework_requirements_error_list_after
-- called right before the closing </ul>
dws_wp_framework_requirements_error_end
-- called right before the closing </div>
dws_wp_framework_requirements_error_after
-- called after the entire HTML output of the notice
All actions receive the same arguments as the dws_wp_framework_output_requirements_error
function. In order, those are:
The name of the component triggering the requirements error output.
The version of the said component.
The minimum PHP version required by said component.
The minimum WP version required by said component.
Any optional arguments passed on (array).
All the bootstrap files of the DWS Framework are backwards compatible with PHP5.3. However, we obviously can't guarantee the same thing for any 3rd-party libraries you might bundle with your plugin. We have had success ensuring this using bundled as a Composer script in .