Skip to content

Commit c827b26

Browse files
authored
gw-replace-page-numbers-with-letters.php: Added snippet to replace page number (1, 2, 3) with letters (A, B, C).
1 parent df22c19 commit c827b26

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Gravity Wiz // Gravity Forms // Replace Page Numbers with Letters
4+
* https://gravitywiz.com/
5+
*/
6+
add_filter( 'gform_progress_steps', function( $markup, $form ) {
7+
preg_match_all( '/<span class=\'gf_step_number.*?\'>(\d+)<\/span>/', $markup, $matches );
8+
foreach ( $matches[1] as $index => $value ) {
9+
$search = $matches[0][ $index ];
10+
$replace = str_replace( $value, chr( 64 + $value ), $search );
11+
$markup = str_replace( $search, $replace, $markup );
12+
}
13+
return $markup;
14+
}, 10, 2 );

0 commit comments

Comments
 (0)