Created
July 27, 2021 18:54
-
-
Save travislopes/ec5fdff19b1f0a04217a07ac42bb9d14 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sort forms in Gravity Forms block in alphabetical order. | |
* | |
* @param array $forms A collection of active forms on site. | |
*/ | |
add_filter( 'gform_block_form_forms', function( $forms ) { | |
usort( $forms, function( $a, $b ) { | |
return strcmp( $a['title'], $b['title'] ); | |
} ); | |
return $forms; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment