Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/cjbodullo/hc-registration-plugin/archive/refs/heads/main.zipWordPress plugin that renders a healthcare-centre registration form via shortcode. Styling aligns with the photo release form (colours, section headings) and the distributor step-one field layout, without loading Bootstrap or jQuery from CDNs.
Text domain: pampers-hc-registration
Version: 1.0.0 (HCR_VERSION in the main plugin file).
Requirements
- WordPress 5.x or newer (uses
admin-post.php, nonces,dbDelta, block-friendly shortcodes).
Installation
- Copy the folder
hc-registration-pluginintowp-content/plugins/. - In Plugins, activate Pampers Swaddlers Healthcare Centres Registration.
- Add a shortcode to any page or post (Classic editor, Shortcode block, etc.).
Shortcodes
| Shortcode | Use |
|---|---|
[pampers_hc_registration] |
Renders the registration form |
Attributes
| Attribute | Description |
|---|---|
thank_you_url |
Optional. After a successful submit, redirect here. If omitted, the user stays on the same page (query args cleaned). |
contact_email |
Email shown on the thank-you screen. Default: info@babybrands.com. |
notification_email |
Optional. If set to a valid address, a plain-text summary is sent with wp_mail on each submission. |
Example
[pampers_hc_registration contact_email="support@example.com" notification_email="admin@example.com"]
Form contents (summary)
- General information: Organization name, contact name, email, job title, department, phone, extension.
- Shipping information: Address, suite, city, province (Canada), postal code (validated as
A1A 1A1). - Category (single choice) and patients type (Prenatal / Postnatal / Both).
- Weekly volume: Numeric “expecting parents per week”.
- Packages:
12or24. - Confirmation: Required checkbox for Pampers Swaddlers distribution / QR wording.
Submissions are validated on the client (basic patterns) and on the server (sanitization, allowed values, nonce).
Database
On init, the plugin creates or updates:
Table: {wpdb_prefix}hc_registration_submissions
Columns include: organization and contact fields, address fields, category, patients_type, weekly_expecting_parents, number_of_packages, confirmed_distribution, created_at. All VARCHAR columns are nullable (NULL DEFAULT NULL). confirmed_distribution remains TINYINT NOT NULL DEFAULT 0 and created_at is NOT NULL. The table is created or brought in line with dbDelta() on init.
Assets
Place or replace files under assets/images/ as needed:
step1.webp— header image above the title.samplits-logo.png— footer / thank-you branding.distributors-banner-thankyou.webp— thank-you banner.
Styles: assets/css/hc-registration.css (self-contained layout and form primitives; no Bootstrap bundle).
Developer hooks
hcr_contact_email— Filter the resolved contact email (shortcode + validation).hcr_send_notification_email—(bool $send, int $insert_id)— Returnfalseto skip the admin notification email.
Submission flow
- Form posts to
admin-post.phpwithaction=hcr_healthcare_register(constantHCR_POST_ACTIONin the main plugin file). - Hooks:
admin_post_hcr_healthcare_registerandadmin_post_nopriv_hcr_healthcare_register. Deprecatedadmin_post_*hooks forhcr_submit_registrationremain registered so briefly cached form HTML from an earlier plugin version can still post until the page is refreshed. - Success and error states return to the form URL with
hcr_status/hcr_messagequery args; the shortcode clears them from the address bar with a small inline script where applicable.
WordPress admin (review submissions)
- In the dashboard sidebar: HC registrations (clipboard icon). Requires the
manage_optionscapability (typically Administrators). - Paginated list (20 per page) with sortable columns.
- Actions column (last): View (read-only detail), Edit (full form, same validation as the public form), Delete (nonce-protected
admin-post.phpaction; browser confirm before delete). - Detail screen also has Edit and Delete at the bottom. After a successful save you are returned to the detail view with a success notice.
- Admin screen slug:
hcr-submissions(admin.php?page=hcr-submissions).