Simple, accessible forms.
See issues.
Please read DTRT WordPress Plugin Boilerplate: Workflows.
Please read the WordPress readme.txt.
Limited restyling of the WP Admin plugin options page.
Styling and jQuery validation of the standard comment form (#commentform
).
Please use the provided shortcode to embed a custom form:
<!-- within the editor -->
[wpdtrt_form option="value"]
// in a PHP template, as a template tag
<?php echo do_shortcode( '[wpdtrt_form option="value"]' ); ?>
Options
template="contact"
- generate a form from the template and JSON dataerrors_list="1|0"
- display a list of errors above the form; clicking an error jumps the user to the affected fielderrors_inline="1|0"
- display each error directly after the affected field;Edit the data file to change the field attributes or order: ./data/form-{templatename}.json
Core CSS properties may be overwritten by changing the variable values in your theme stylesheet.
See scss/variables/_css.scss
.
Inline validation works with or without JavaScript, but is faster when JavaScript is enabled.
See plugin settings page in WP Admin.
Install and run MailCatcher (see https://wordpress.stackexchange.com/a/195830):
gem install mailcatcher
mailcatcher
Update php.ini:
# php.ini (MAMP Pro: File > Edit > PHP > Version)
sendmail_path = /Users/dan/.rvm/gems/ruby-2.6.3/wrappers/catchmail -f wpdev@localhost.dev # any email works
smtp_port = 1025
MAMP Pro View > Postfix
localhostname.tld
127.0.0.1:1080
Send mail
Watch for mail at http://127.0.0.1:1080/
Update php.ini (https://tommcfarlin.com/mailcatcher-mamp-wordpress/):
# php.ini
smtp_port = 1025
sendmail_path = /usr/bin/env catchmail -f wpdev@localhost.dev
Send mail:
# Apache log
env: catchmail: No such file or directory
Locate the path where gems are installed:
gem environment --help
gem environment gemdir # /Users/dan/.rvm/gems/ruby-2.6.3
Locate the catchmail
binary (executable):
cd /Users/dan/.rvm/gems/ruby-2.6.3 && ls # bin build_info cache doc environment extensions gems specifications wrappers
Update php.ini:
# php.ini
sendmail_path = /Users/dan/.rvm/gems/ruby-2.6.3/bin/catchmail -f wpdev@localhost.dev`
Send mail:
# Apache log
send mail > env: ruby_executable_hooks: No such file or directory
Refresh the executable-hooks
to the latest version (https://stackoverflow.com/a/29519638):
sudo gem install --user-install executable-hooks
Send mail:
# Apache log
send mail > env: ruby_executable_hooks: No such file or directory
Locate ruby_executable_hooks
:
which ruby_executable_hooks # /Users/dan/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks
# unsure how to use this information..
Update php.ini:
# php.ini
sendmail_path = /Users/dan/.rvm/gems/ruby-2.6.3/environment catchmail -f wpdev@localhost.dev
Send mail:
# Apache log
Users/dan/.rvm/gems/ruby-2.6.3/environment: Permission denied
Update php.ini (https://github.com/rvm/executable-hooks/issues/6#issuecomment-609032741):
# php.ini
sendmail_path = /Users/dan/.rvm/gems/ruby-2.6.3/wrappers/catchmail -f wpdev@localhost.dev
Send mail :)