PHPackages                             tghp/tghp-mb-contact - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tghp/tghp-mb-contact

ActiveWordpress-plugin

tghp/tghp-mb-contact
====================

1.2.1(3y ago)034PHP

Since Jul 2Pushed 2mo agoCompare

[ Source](https://github.com/tghp/tghp-mb-contact)[ Packagist](https://packagist.org/packages/tghp/tghp-mb-contact)[ RSS](/packages/tghp-tghp-mb-contact/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

TGHP MB Contact
===============

[](#tghp-mb-contact)

Re-usable plugin using metabox.io and MB Frontend Submission to provide code-powerable and extensible forms. Forms are defined as in with metabox, with some extra features added.

Extra Metabox Parameters
------------------------

[](#extra-metabox-parameters)

### `options`

[](#options)

KeyValue`delete_after_processing`After all hooks are fired, delete the post. Useful for facilitating transient submissions utilising an integration and with no desire to store locally (e.g. newsletter subscriptions).
Post will not be deleted in any case if `_tghpcontact_do_not_delete` metafield has a value of '1'. This can be used to prevent this deletion in case of a failure.`email->email`Email address to send submisions to`email->title`Title of the form`redirect`URL to redirect to after submission`class`Extra CSS classes to add to the form wrapper element`button_class`Extra CSS classes to add to buttons`submit_class`Extra CSS classes to add to the submit button`submit_text_sr_only`Wrap submit button in a .sr-only span`ajax`Boolean. Enable AJAX for instances of the form`confirmation`Confirmation messageExtra Metabox Field Parameters
------------------------------

[](#extra-metabox-field-parameters)

KeyValue`email`Boolean. Whether the field is added to the generated emailShortcode
---------

[](#shortcode)

`[tghpcontact_form]`

ParameterDescription`id`ID of form to output`title`Output this title`hide`Whether to hide the form initially or not`hide_button_label`Label for button that shows form. Default: 'Show Form'`hide_button_class`CSS classes added to button that shows form. Default: 'button button-secondary'`background`Applies a background colour to inputs which have a value (for fake placeholders, see Native)Available Filters
-----------------

[](#available-filters)

`tghpcontact_forms`

ParameterDescription`$contactForms`Key/value array of forms, add to this to add a form. With your form ID as the key and metabox definition as the value.---

`tghpcontact_fields`

ParameterDescription`$contactFields`Array of fields for this form`$form`The form passed to the filter---

`tghpcontact_fields_{$formId}`

`$formId` is the ID of the form relevant (the key in the key/value array)

ParameterDescription`$contactFields`Array of fields for this form`$form`The form passed to the filter---

`tghpcontact_email_subject`

ParameterDescription`$subject`The email subject`$config`Data about the relevant form (comes from MB Frontend Submission)`$postId`ID of the post created we are editing the email for---

`tghpcontact_email_content`

ParameterDescription`$subject`The email content`$config`Data about the relevant form (comes from MB Frontend Submission)`$postId`ID of the post created we are editing the email forUseful features
---------------

[](#useful-features)

### Recaptcha

[](#recaptcha)

A new recaptcha field type is available provided by this plugin:

```
array(
    'id' => 'g-recaptcha',
    'type' => 'recaptcha',
),

```

However a site and secret key is provided. The plugin will look for these using getenv in the following format:

- `RECAPTCHA_KEY_SITE_{$formId}`
- `RECAPTCHA_KEY_SECRET_{$formId}`

So a recaptcha instance and environment variable for each form is required. This is important as only one site/secret key can be used once on page. So if we were to use just one pair, only one form of any ID would be placeable on a page. This way you can place more

### JavaScript

[](#javascript)

#### Message event

[](#message-event)

When a message is trigged (confirmation or error) an event `tghpcontact:message-show` will get dispatched on the body element. This can be used to add scroll to message logic. This event is passed a single parameter of a jQuery object matching the message element.

Example usage:

```
var $header = $('#masthead'),
    $window = $(window);
$(body).on('tghpcontact:message-shown', function (e, el) {
    $window.scrollTop($(el).offset().top - $masthead.height() - 20);
});

```

It's important this plugin doesn't implement this as each site will need different offset positions due to header sizes.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance56

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~227 days

Total

3

Last Release

1322d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3252419641af2070a545154d69d059c17fce58e09f5d2e5054634cad91609348?d=identicon)[tghp](/maintainers/tghp)

---

Top Contributors

[![joshdavenport](https://avatars.githubusercontent.com/u/757828?v=4)](https://github.com/joshdavenport "joshdavenport (84 commits)")[![orhanck](https://avatars.githubusercontent.com/u/35725940?v=4)](https://github.com/orhanck "orhanck (5 commits)")

### Embed Badge

![Health badge](/badges/tghp-tghp-mb-contact/health.svg)

```
[![Health](https://phpackages.com/badges/tghp-tghp-mb-contact/health.svg)](https://phpackages.com/packages/tghp-tghp-mb-contact)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
