Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/mattpatterson94/mp-forms/archive/refs/heads/master.zipReadme
MP-Forms
License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html
Description
A wordpress plugin to create custom form. Made for developers.
Installation Manually
- Download the latest archive and extract to a folder
- Upload the plugin to the
/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Ensure you update the recaptcha code in
mpforms.php
Development
If you plan to make changes to the form or add new forms, ensure your device has the plugin dependencies installed.
yarn installto install node modulesnpx webpackto watch for changes
i18n Tools
The Plugin uses a variable to store the text domain used when internationalizing strings throughout the code. To take advantage of this method, there are tools that are recommended for providing correct, translatable files:
Any of the above tools should provide you with the proper tooling to internationalize the plugin.
However, if you still face problems translating the strings with an automated tool/process, replace $this->plugin_text_domain with the literal string of your plugin's text domain.
Adding new forms
The code for each form is kept in a few places:
inc/admin/forms # backend code to display form data from DB
inc/frontend/forms # frontend code to display the form
Steps to clone
- Start by copying the form folders in the locations mentioned above and pasting them with its new name
- Update namespaces and class names.
- Update db.php with the fields for your new form. Note that this db.php file is read when the plugin is activated. If you add a new form toggle the plugina activation.
- Update the webpack.config.js to have the new form for building js.
- Ensure you have updated the render_mail_html in the frontend class with the fields you added in the db.php.
- Get coding! Update the form.php file with the form. Follow the current form as an example.