Forms & Popups, General Questions, Website management

How to create custom actions in globally connected forms

Greyd.Suite enables you to synchronize posts across several websites with Global Content. However, you can customize specific meta fields — like a forms admin mail_to field — locally for individual posts without disrupting global synchronization.

How it works

With a simple code snippet added to your child theme's functions.php you can:

  1. enable local editing of any meta field in the admin interface.
  2. preserve local field values during global synchronization.
  3. control updates to linked posts based on specific meta field conditions.

That’s how it looks

Backend screenshot of Greyd.Forms follow-up actions with recipient field filled out

Adapting for Any Meta Field

This approach is not limited to mail_to or not even to the post type forms. You can customize any meta field for any post type by replacing mail_to with your desired meta key and also adjusting the post type value. Adjust the snippet logic as needed for your use case.

Example Use Case

Synchronize a global post type while allowing localized values, such as region-specific email addresses or descriptions, ensuring consistency and flexibility.

/**
* Enable editing of the „mail_to“ field in the Forms post type.
* This functionality ensures that the „mail_to“ field can be customized locally, even for globally synchronized forms.
* It also ensures that buttons like „publish“ remain accessible for posts with global content links.
*/
function admin_forms_enable_metabox_field() {
global $post_type;
if ( ‚tp_forms‘ === $post_type ) {
echo “;
}
}
add_action( ‚admin_head‘, ‚admin_forms_enable_metabox_field‘ );

/**
* Prevent overwriting of the „mail_to“ meta value when syncing forms via global content.
* This ensures the locally defined „mail_to“ value remains intact.
*
* @param mixed $meta_value The current meta value for „mail_to“.
* @param int $post_id The ID of the post being synced.
* @param WP_Post $post The post object being synced.
*
* @return mixed The „mail_to“ value from the local post.
*/
function filter_mail_to_field_before_import( $meta_value, $post_id, $post ) {
return get_post_meta( $post_id, ‚mail_to‘, true );
}
add_filter( ‚greyd_import_post_meta-mail_to‘, ‚filter_mail_to_field_before_import‘, 10, 3 );

/**
* Allow updates to linked posts only if the „mail_to“ field is defined.
* This provides granular control over synchronization behavior.
*
* @param bool $allow Whether the update should be allowed.
* @param int $post_id The ID of the post being checked.
*
* @return bool Whether to allow the update of the linked post.
*/
function allow_update_of_linked_post_with_mail_to_field( $allow, $post_id ) {
$meta = get_post_meta( $post_id, ‚mail_to‘, true );
if ( ! empty( $meta ) ) {
$allow = true;
}
return $allow;
}
add_filter( ‚gc_allow_update_of_linked_post‘, ‚allow_update_of_linked_post_with_mail_to_field‘, 10, 2 );

Ähnliche Artikel & Tutorials

Hinweis: Die Hilfsartikel stehen derzeit nur auf Englisch zur Verfügung.

How to set up Google Tag Manager event Tracking for Greyd.Forms

This article explains, how you can track form events from your Greyd.Forms forms in Google Analytics using the Google Tag Manager. Step 1: Create variables The variables ensure that a Greyd form is recognized on a page and that the form CSS ID, form post ID and form name are read out. The form CSS […]


Forms & Popups

How to create custom actions in globally connected forms

Greyd.Suite enables you to synchronize posts across several websites with Global Content. However, you can customize specific meta fields — like a forms admin mail_to field — locally for individual posts without disrupting global synchronization.How it works With a simple code snippet added to your child theme's functions.php you can:enable local editing of any meta […]


Forms & Popups, General Questions, Website management

I get a notice that a main element is missing?

HTML elements define the structure of your pages. One of those tags is <main> defining the part of a page containing the content. Among others, this is relevant for accessibility, i.e. for skip links to skip menus or forms to jump to the right position. In Block Themes the main element often lies in your […]


General Questions, Templates & Post Types

How do I integrate external code snippets?

Depending on the Greyd.Suite version you are working with, there are various possibilities: You can easily insert code snippets at the end of the <head> and <body> tags in the Greyd.Suite settings: You can use the HTML block in the Block Editor and insert it in your header and/or footer template(s). In general, please note that […]


General Questions, Website management

How can I switch to a child theme?

In this article we describe how you can switch to a child theme when you have already created contents, layouts and design that you do not want to loose:Keep the current theme activeMake a backup of your entire site, the design and files via Greyd.HubIf available, copy the additional CSS in the global styles into […]


General Questions, Templates & Post Types

Why does my site not show skip links?

Skip links are an essential accessibility feature. When someone navigates your website using the key board, skip links make their life a lot easier as they can skip elements like forms or menus if they want to navigate on the site instead of having to go through each and every menu element or form field.With […]


Design, General Questions, Templates & Post Types

What you need to know about HTTP password protection

We often receive support tickets with strange issues that we can later relate to HTTP password protection instead of any issue caused by Greyd.Suite.In general, WordPress often experiences issues when HTTP password protection is used. So, in case you are using HTTP password protection and experience one or several of the following symptoms, we highly […]


General Questions, Website management

Can I use Global Content without granting everyone admin capabilities?

Global Content usually requires you to be an admin. However, you may not want to grant everyone in your content team admin capabilities. And you don’t need to! Once you’ve set-up Global Content, you can benefit from its features without being and admin. Tasks for which you need to be an admin: Connecting different sites […]


Website management

All you need to know about multilingual FSE websites

In this article, we would like to give you some help when it comes to multilingual websites with Full Site Editing.The fact is that not all multilingual solutions are yet compatible with Full Site Editing. We have extensively tested two of the most popular providers – WPML & Polylang – especially in combination with Greyd.Suite. […]


General Questions, How to Start

Where do I find the form ID?

To use the form ID for example in the Conditional Content Block, simply open the corresponding form. You will now find the form ID at the top in the URL, e.g. "post=17967"


Forms & Popups

The Block Editor keeps crashing.

Currently, the WordPress Block Editor still crashes and/or displays errors from time to time. In most cases, you can resolve the problem by simply refreshing your browser window or by clicking the "Attempt Block Recovery" button: Block error message While this may be annoying for the editor, the good news is that in most cases […]


General Questions, How to Start

Where can I see on which domains my license is being used?

Open your Greyd.Suite dashboard (on a site level, not in the network administration) and go to the tab "license" to see all details with regards to your Greyd.Suite license.You will first be asked to enter your license key again for security reasons. Backend screenshot of the settings dashboard in Greyd.Suite Then you will get an […]


General Questions, How to Start

Forms & Popups

Wie erstelle ich Quizz & Live-Umfragen?

In diesem Video zeigen wir dir, wie du mit Greyd.Forms interaktive Gamification-Elemente in deine Formulare einbinden kannst, etwa für Umfragen mit Live-Feedback oder ein Quizz.

Website management

Wie importiere & exportiere ich Inhalte zwischen Websites?

Dieses Video zeigt dir die einfachen Schritte von der Installation der Greyd.Suite bis zum initialen Einrichten Die Greyd.Suite bietet dir ein starkes Import & Export Feature, mit dem du jede Art von Post Type (Seiten, Beiträge, Templates, Formulare, Popups, etc.) von einer Website auf eine andere laden kannst, wobei sich das Design automatisch anpasst.

Website management

Wie verknüpfe ich mehrere Websites / Multisites?

Mit dem Site Connector kannst du alle deine Greyd.Suite Websites zu einem zentralen System verknüpfen – ganz egal ob es sich um einzelne Single Site Installationen oder sogar mehrere Multisites handelt.

Website management

Wie erzeuge ich eine Staging Version meiner Seite?

Staging Seiten ermöglichen dir, sicher neue Designs, Einstellungen und Plugins zu testen, ohne deine Live-Seite zu beeinträchtigen. Mit der Staging Overview behältst du die Kontrolle und verhinderst Datenverluste.

Website management

Wie synchronisiere ich mehrere Websites?

Wir zeigen dir, wie du mit Global Content deine WordPress Multisite zum Headless CMS machst und Inhalte von einer Website automatisiert auf weiteren Seiten ausspielst.

Forms & Popups

Welche generellen Einstellungen in Greyd.Forms gibt es?

Erfahre, wie du einen zentralen Datenschutz-Text für deine Formulare einstellen kannst und wie du deine Formulare gegen Bots & Missbrauch schützen kannst. Das Video zeigt außerdem, wie du verhinderst, dass deine Formularmails im Spam-Ordner landen und wie du Schnittstellen aktivierst.

Forms & Popups

Welche Informationen finde ich im Backend zu meinen Formular-Einträgen?

Das Greyd.Forms Backend zeigt dir alle Formulareinträge inkl. Status übersichtlich auf. Dort kannst du auch Statistiken einsehen und deine Formulare so DSGVO-konform auswerten – ohne ein Analytics-Tool. Im Video zeigen wir dir außerdem, wie du Einträge automatisch löschen lassen kannst.

Forms & Popups

Wie gestalte ich Radio Buttons?

Ähnlich wie bei einer Checkbox kannst du mit Radio Buttons dem Nutzer verschiedene Optionen zur Auswahl anzeigen. Erfahre hier, wie du Radio Buttons in deine Formulare einbindest und gestaltest.

Forms & Popups

Wie erstelle ich intelligente Formulare mit Berechnungen?

Greyd.Forms ermöglicht es dir, mathematische Berechnungen in deine Formulare einzubinden und mithilfe von Schiebereglern interaktive Formulare zu gestalten. In diesem Tutorial erfährst du, wie einfach das funktioniert.

Forms & Popups

Wie setze ich Eingabefelder ein?

Eingabefelder kommen immer dann zum Einsatz, wenn der Nutzer etwas in ein Formular eintragen soll. Wie du Namens-, Adress- oder sonstige Eingabefelder gestaltest und welche Optionen dir dabei zur Verfügung stehen, zeigen wir dir kurz und knapp in diesem Video.

Forms & Popups

Wie gestalte ich Upload-Felder?

Du möchtest, dass der Nutzer eine Datei in deinem Formular hochlädt? Kein Problem! Erfahre hier, welche Möglichkeiten dir Greyd.Forms zur einfachen Einbindung von Upload-Feldern bietet.

Forms & Popups

Wie gestalte ich Dropdown-Felder?

Mit einem Dropdown-Feld kannst du dem Nutzer eine Auswahl verschiedener Optionen in einer Liste zur Verfügung stellen. Welche Einstellungsoptionen du in Greyd.Forms dabei hast, zeigen wir dir in diesem Video.