| CARVIEW |
Select Language
HTTP/2 301
date: Sat, 27 Dec 2025 08:44:54 GMT
content-type: text/html; charset=UTF-8
location: https://docs.gravityforms.com/gform_block_form_forms/
server: cloudflare
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
x-redirect-by: WordPress
fastcgi-cache: MISS
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=Ii3a7L7mgw144NtD6dChc%2FEo%2FVEIMwXBhLlQAS4K%2FlW5IZQ2hFjgWpV4mfomeO0%2F0nXigo9o2XLOT1v%2BF88V%2FOWRxIFB8nABO7B%2B%2Bgofc1HnoDem"}]}
cf-ray: 9b4789e5fae625e0-BLR
HTTP/2 200
date: Sat, 27 Dec 2025 08:44:55 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
vary: Accept-Encoding
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
link: ; rel="https://api.w.org/"
link: ; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
fastcgi-cache: HIT
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=%2FxXDcDbGn1%2Falvza6dHAK727MLWknzs9K8cKE58uQReEHS9%2BkY035slhqu5C1%2BbWjVAY%2Fwed7U3CFvqSWYc6ZwcmoEwDk4ZELHQKuLZDeGxv%2BLY6"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 9b4789e8fe8b25e0-BLR
gform_block_form_forms - Gravity Forms Documentation
gform_block_form_forms
Description
The gform_block_form_forms filter allows the list of available forms displayed in the Form block to be overridden.
Usage
The filter would be used like so:
add_filter( 'gform_block_form_forms', 'your_function_name' );
Parameters
- $forms array
A collection of active forms on site. The array for each form contains the following properties: id, title, and hasConditionalLogic. As of Gravity Forms 2.5, this array is sorted alphabetically by title. It was previously sorted incrementally by id.
Examples
1. Remove
This example removes form id 1 from the list of forms which can be embedded using the Form block in the WordPress block editor.
add_filter( 'gform_block_form_forms', function ( $forms ) {
foreach ( $forms as $key => $form ) {
if ( $form['id'] == 1 ) {
unset( $forms[ $key ] );
break;
}
}
return array_values( $forms );
} );
2. Sort list newest to oldest
This example sorts the list of forms with most recent forms listed at the the top. (requires PHP 7 or greater)
add_filter( 'gform_block_form_forms', function ( $forms ) {
usort( $forms, function( $a, $b ) {
return $b['id'] <=> $a['id'];
});
return $forms;
} );
Placement
This code should be placed in the functions.php file of your active theme or a custom functions plugin.
Since
This filter was added in Gravity Forms v2.4.22.5.
Source Code
This filter is located in GF_Block_Form::get_forms() in includes/blocks/class-gf-block-form.php.