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 '<style>
			textarea[name="mail_to"],
			body.gc_linked .editor-post-publish-button__button {
				cursor: initial !important;
				pointer-events: unset !important;
				opacity: 1 !important;
			}
		</style>';
	}
}
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 );

Related articles & tutorials

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

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

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

Website management

How do I create staging versions of my website?

Staging sites allow you to safely test new designs, settings, and plugins without affecting your live site. The staging overview keeps you in control and prevents data loss.

Forms & Popups

How to create quiz & live surveys

In this video, we are going to show you how to create interactive gamification elements in Greyd.Forms and add for example a quizz or survey with live feedback to your forms.

Website management

How do I create custom user roles?

With the user management of Greyd.Suite you can create custom user roles and define in detail who should be able to see and/or edit what on your website. You also benefit from time-saving admin functions.

Website management

How do I import / export content between websites?

Greyd.Suite offers you a very powerful import & export feature to copy any post type (e.g. pages, templates, forms, popups, posts, etc.) from website to another. Watch this video to see how it works.

Forms & Popups

How do I use input fields?

Input fields are used wherever you want the user to enter something. In this video, we will show you how to set up fields for name, address or other inputs and which settings you can make.

Forms & Popups

What are the basic settings in Greyd.Forms?

Learn how to deposit a general privacy text for your forms and how to protect them against bots & malware. The video also shows you how to prevent your form mails from ending up in the spam folder and how to connect Greyd.Forms with your tools.

Website management

How can I publish content on several websites?

Let us show you how to make your WordPress multisite a headless CMS to publish content from one website automatically on several sites.

Forms & Popups

How can I make fields dependent from each other?

The conditional container block allows you to create dependencies between fields. Define, which fields should open after the user has chosen option A or B. Decide, if certain questions should be skipped depending on the user's entries.Learn here, how easy it is to create dependencies in Greyd.Forms.

Forms & Popups

How do I use image panels?

Image panels are a very good way to make your form more stylish. Instead of simple selection fields, show your user clickable image panels. This tutorial shows you the abundant, yet simple settings of the image panel block.

Forms & Popups

How do I use dropdown fields?

Allow your user to select from a dropdown list with the dropdown block. This video shows you which settings you can make.

Forms & Popups

How do I use radio buttons?

Similar to checkboxes, radio buttons are used to make a user select one of several options. Learn here how to use radio buttons.

Forms & Popups

How do I create a multistep form?

Especially for longer forms it may be useful to build your form with several steps. With next/back buttons users can navigate between the levels of your forms. Learn here how to easily create a multistep form with Greyd.Forms.