Skip to content

Commit 7bf7908

Browse files
authored
Fix esc_html() to esc_html__() for translatable strings
Corrects i18n function usage to make strings translatable. Updates field labels, settings, and admin notices across class-ui.php, listings.php, and stripe.php (30 lines total).
1 parent c723ff6 commit 7bf7908

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

src/includes/class-ui.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public static function subline( $v ) {
219219
}
220220
echo '<span class="sfui-subline"><i>' . $v['subline'];
221221
if ( ! empty( $v['accepted_values'] ) ) {
222-
echo ' ' . esc_html( 'Accepted values', 'super-forms' ) . ': ';
222+
echo ' ' . esc_html__( 'Accepted values', 'super-forms' ) . ': ';
223223
$x = 0;
224224
foreach ( $v['accepted_values'] as $iv ) {
225225
if ( $iv['v'] === 'signup_payment_processing' ) {

src/includes/extensions/listings/listings.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -857,23 +857,23 @@ public static function add_tab_content( $atts ) {
857857
),
858858
array(
859859
'name' => 'user_roles',
860-
'title' => 'User roles: ',
860+
'title' => esc_html__( 'User roles: ', 'super-forms' ),
861861
'subline' => esc_html__( 'Seperated by comma e.g: administrator,editor, or leave blank to allow all roles', 'super-forms' ),
862862
'type' => 'text',
863863
'default' => 'administrator',
864864
'filter' => 'view_any.enabled;true',
865865
),
866866
array(
867867
'name' => 'user_ids',
868-
'title' => 'User ID\'s: ',
868+
'title' => esc_html__( "User ID's: ", 'super-forms' ),
869869
'subline' => esc_html__( 'Seperated by comma e.g: 32,2467,1870, or leave blank to only filter by the roles defined above', 'super-forms' ),
870870
'type' => 'text',
871871
'default' => '',
872872
'filter' => 'view_any.enabled;true',
873873
),
874874
array(
875875
'name' => 'html_template',
876-
'title' => esc_html( 'View template HTML', 'super-forms' ),
876+
'title' => esc_html__( 'View template HTML', 'super-forms' ),
877877
'subline' => esc_html__( 'When viewing an entry, you can create your own HTML view (leave blank to use the default template)', 'super-forms' ),
878878
'type' => 'textarea',
879879
'default' => $html_template,
@@ -882,7 +882,7 @@ public static function add_tab_content( $atts ) {
882882
),
883883
array(
884884
'name' => 'loop_html',
885-
'title' => esc_html( 'Loop fields HTML', 'super-forms' ),
885+
'title' => esc_html__( 'Loop fields HTML', 'super-forms' ),
886886
'subline' => esc_html__( 'If you use {loop_fields} inside your custom template, you can define the "row" here and retrieve the field values with {loop_label} and {loop_value} tags, leave blank to use the default loop HTML', 'super-forms' ),
887887
'type' => 'textarea',
888888
'default' => $loop_html,
@@ -904,23 +904,23 @@ public static function add_tab_content( $atts ) {
904904
),
905905
array(
906906
'name' => 'user_roles',
907-
'title' => 'User roles: ',
907+
'title' => esc_html__( 'User roles: ', 'super-forms' ),
908908
'subline' => esc_html__( 'Seperated by comma e.g: administrator,editor, or leave blank to allow all roles', 'super-forms' ),
909909
'type' => 'text',
910910
'default' => 'administrator',
911911
'filter' => 'view_own.enabled;true',
912912
),
913913
array(
914914
'name' => 'user_ids',
915-
'title' => 'User ID\'s: ',
915+
'title' => esc_html__( "User ID's: ", 'super-forms' ),
916916
'subline' => esc_html__( 'Seperated by comma e.g: 32,2467,1870, or leave blank to only filter by the roles defined above', 'super-forms' ),
917917
'type' => 'text',
918918
'default' => '',
919919
'filter' => 'view_own.enabled;true',
920920
),
921921
array(
922922
'name' => 'html_template',
923-
'title' => esc_html( 'View template HTML', 'super-forms' ),
923+
'title' => esc_html__( 'View template HTML', 'super-forms' ),
924924
'subline' => esc_html__( 'When viewing an entry, you can create your own HTML view (leave blank to use the default template)', 'super-forms' ),
925925
'type' => 'textarea',
926926
'default' => $html_template,
@@ -929,7 +929,7 @@ public static function add_tab_content( $atts ) {
929929
),
930930
array(
931931
'name' => 'loop_html',
932-
'title' => esc_html( 'Loop fields HTML', 'super-forms' ),
932+
'title' => esc_html__( 'Loop fields HTML', 'super-forms' ),
933933
'subline' => esc_html__( 'If you use {loop_fields} inside your custom template, you can define the "row" here and retrieve the field values with {loop_label} and {loop_value} tags, leave blank to use the default loop HTML', 'super-forms' ),
934934
'type' => 'textarea',
935935
'default' => $loop_html,
@@ -957,15 +957,15 @@ public static function add_tab_content( $atts ) {
957957
),
958958
array(
959959
'name' => 'user_roles',
960-
'title' => 'User roles: ',
960+
'title' => esc_html__( 'User roles: ', 'super-forms' ),
961961
'subline' => esc_html__( 'Seperated by comma e.g: administrator,editor, or leave blank to allow all roles', 'super-forms' ),
962962
'type' => 'text',
963963
'default' => 'administrator',
964964
'filter' => 'edit_any.enabled;true',
965965
),
966966
array(
967967
'name' => 'user_ids',
968-
'title' => 'User ID\'s: ',
968+
'title' => esc_html__( "User ID's: ", 'super-forms' ),
969969
'subline' => esc_html__( 'Seperated by comma e.g: 32,2467,1870, or leave blank to only filter by the roles defined above', 'super-forms' ),
970970
'type' => 'text',
971971
'default' => '',
@@ -1206,7 +1206,7 @@ public static function add_tab_content( $atts ) {
12061206
'nodes' => array(
12071207
array(
12081208
'name' => 'type',
1209-
'subline' => esc_html( 'Link', 'super-forms' ),
1209+
'subline' => esc_html__( 'Link', 'super-forms' ),
12101210
'type' => 'select',
12111211
'options' => array(
12121212
'none' => esc_html__( 'None', 'super-forms' ),
@@ -1228,7 +1228,7 @@ public static function add_tab_content( $atts ) {
12281228
),
12291229
array(
12301230
'name' => 'url',
1231-
'subline' => esc_html( 'Enter custom URL (use {tags} if needed):', 'super-forms' ),
1231+
'subline' => esc_html__( 'Enter custom URL (use {tags} if needed):', 'super-forms' ),
12321232
'type' => 'text',
12331233
'default' => '',
12341234
'filter' => $sk . '_column.link.type;custom',
@@ -1239,14 +1239,14 @@ public static function add_tab_content( $atts ) {
12391239
array(
12401240
'width_auto' => true,
12411241
'name' => 'width',
1242-
'subline' => esc_html( 'Width (px)', 'super-forms' ),
1242+
'subline' => esc_html__( 'Width (px)', 'super-forms' ),
12431243
'type' => 'number',
12441244
'default' => '150',
12451245
),
12461246
array(
12471247
'width_auto' => true,
12481248
'name' => 'order',
1249-
'subline' => esc_html( 'Order', 'super-forms' ),
1249+
'subline' => esc_html__( 'Order', 'super-forms' ),
12501250
'type' => 'number',
12511251
'default' => '10',
12521252
),
@@ -1259,7 +1259,7 @@ public static function add_tab_content( $atts ) {
12591259
array(
12601260
'width_auto' => true,
12611261
'name' => 'enabled',
1262-
'title' => esc_html( 'Allow filter', 'super-forms' ),
1262+
'title' => esc_html__( 'Allow filter', 'super-forms' ),
12631263
'type' => 'checkbox',
12641264
'default' => 'true',
12651265
),
@@ -1271,7 +1271,7 @@ public static function add_tab_content( $atts ) {
12711271
'nodes' => array(
12721272
array(
12731273
'name' => 'placeholder',
1274-
'title' => esc_html( 'Filter placeholder', 'super-forms' ),
1274+
'title' => esc_html__( 'Filter placeholder', 'super-forms' ),
12751275
'type' => 'text',
12761276
'default' => 'search...',
12771277
'i18n' => true,
@@ -1283,7 +1283,7 @@ public static function add_tab_content( $atts ) {
12831283
array(
12841284
'width_auto' => true,
12851285
'name' => 'sort',
1286-
'title' => esc_html( 'Allow sorting', 'super-forms' ),
1286+
'title' => esc_html__( 'Allow sorting', 'super-forms' ),
12871287
'type' => 'checkbox',
12881288
'default' => ( ! empty( $sv['default'] ) ? $sv['default'] : '' ),
12891289
),
@@ -1343,7 +1343,7 @@ public static function add_tab_content( $atts ) {
13431343
array(
13441344
'width_auto' => true,
13451345
'name' => 'type',
1346-
'subline' => esc_html( 'Link', 'super-forms' ),
1346+
'subline' => esc_html__( 'Link', 'super-forms' ),
13471347
'type' => 'select',
13481348
'options' => array(
13491349
'none' => esc_html__( 'None', 'super-forms' ),
@@ -1365,7 +1365,7 @@ public static function add_tab_content( $atts ) {
13651365
),
13661366
array(
13671367
'name' => 'url',
1368-
'title' => esc_html( 'Enter custom URL (use {tags} if needed):', 'super-forms' ),
1368+
'title' => esc_html__( 'Enter custom URL (use {tags} if needed):', 'super-forms' ),
13691369
'type' => 'text',
13701370
'default' => '',
13711371
'filter' => 'link.type;custom',
@@ -1376,14 +1376,14 @@ public static function add_tab_content( $atts ) {
13761376
array(
13771377
'width_auto' => true,
13781378
'name' => 'width',
1379-
'subline' => esc_html( 'Width (px)', 'super-forms' ),
1379+
'subline' => esc_html__( 'Width (px)', 'super-forms' ),
13801380
'type' => 'number',
13811381
'default' => '150',
13821382
),
13831383
array(
13841384
'width_auto' => true,
13851385
'name' => 'order',
1386-
'subline' => esc_html( 'Order', 'super-forms' ),
1386+
'subline' => esc_html__( 'Order', 'super-forms' ),
13871387
'type' => 'number',
13881388
'default' => '10',
13891389
),
@@ -1396,7 +1396,7 @@ public static function add_tab_content( $atts ) {
13961396
array(
13971397
'width_auto' => true,
13981398
'name' => 'enabled',
1399-
'title' => esc_html( 'Allow filter', 'super-forms' ),
1399+
'title' => esc_html__( 'Allow filter', 'super-forms' ),
14001400
'type' => 'checkbox',
14011401
'default' => 'true',
14021402
),
@@ -1408,15 +1408,15 @@ public static function add_tab_content( $atts ) {
14081408
'nodes' => array(
14091409
array(
14101410
'name' => 'placeholder',
1411-
'title' => esc_html( 'Filter placeholder', 'super-forms' ),
1411+
'title' => esc_html__( 'Filter placeholder', 'super-forms' ),
14121412
'type' => 'text',
14131413
'default' => 'search...',
14141414
'i18n' => true,
14151415
),
14161416
array(
14171417
'width_auto' => true,
14181418
'name' => 'type',
1419-
'subline' => esc_html( 'Filter method', 'super-forms' ),
1419+
'subline' => esc_html__( 'Filter method', 'super-forms' ),
14201420
'type' => 'select',
14211421
'options' => array(
14221422
'text' => esc_html__( 'Text field (default)', 'super-forms' ),
@@ -1426,7 +1426,7 @@ public static function add_tab_content( $atts ) {
14261426
),
14271427
array(
14281428
'name' => 'items',
1429-
'title' => esc_html( 'Filter options', 'super-forms' ),
1429+
'title' => esc_html__( 'Filter options', 'super-forms' ),
14301430
'subline' => esc_html__( 'put each on a new line', 'super-forms' ),
14311431
'type' => 'textarea',
14321432
'placeholder' => "red|Red\ngreen|Green\nblue|Blue",
@@ -1441,7 +1441,7 @@ public static function add_tab_content( $atts ) {
14411441
array(
14421442
'width_auto' => true,
14431443
'name' => 'sort',
1444-
'title' => esc_html( 'Allow sorting', 'super-forms' ),
1444+
'title' => esc_html__( 'Allow sorting', 'super-forms' ),
14451445
'type' => 'checkbox',
14461446
'default' => 'true',
14471447
),

src/includes/extensions/stripe/stripe.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ public static function redirect_to_stripe_checkout( $x ) {
11531153
$webhookSecret = ( isset( $global_settings[ 'stripe_' . $api['stripe_mode'] . '_webhook_secret' ] ) ? $global_settings[ 'stripe_' . $api['stripe_mode'] . '_webhook_secret' ] : '' );
11541154
if ( empty( $webhookId ) ) {
11551155
$msg = sprintf(
1156-
esc_html( 'Please enter your webhook ID under:%s%sSettings > Stripe Checkout%s.%sIt should start with `we_`.%sYou can find your Webhook ID via %swebhook settings%s.', 'super-forms' ),
1156+
esc_html__( 'Please enter your webhook ID under:%s%sSettings > Stripe Checkout%s.%sIt should start with `we_`.%sYou can find your Webhook ID via %swebhook settings%s.', 'super-forms' ),
11571157
'<br />',
11581158
'<a target="_blank" href="' . esc_url( admin_url() . 'admin.php?page=super_settings#stripe-checkout' ) . '">',
11591159
'</a>',
@@ -1168,7 +1168,7 @@ public static function redirect_to_stripe_checkout( $x ) {
11681168
}
11691169
if ( empty( $webhookSecret ) ) {
11701170
$msg = sprintf(
1171-
esc_html( 'Please enter your webhook secret under:%s%sSettings > Stripe Checkout%s.%sIt should start with `whsec_`.%sYou can find your Stripe endpoint\'s secret via %swebhook settings%s.', 'super-forms' ),
1171+
esc_html__( 'Please enter your webhook secret under:%s%sSettings > Stripe Checkout%s.%sIt should start with `whsec_`.%sYou can find your Stripe endpoint\'s secret via %swebhook settings%s.', 'super-forms' ),
11721172
'<br />',
11731173
'<a target="_blank" href="' . esc_url( admin_url() . 'admin.php?page=super_settings#stripe-checkout' ) . '">',
11741174
'</a>',
@@ -1187,7 +1187,7 @@ public static function redirect_to_stripe_checkout( $x ) {
11871187
// Check if $webhookUrl ends with $endsWith
11881188
if ( substr( trailingslashit( $webhook['url'] ), -strlen( $endsWith ) ) !== $endsWith ) {
11891189
$msg = sprintf(
1190-
esc_html( 'Please update your Webhook endpoint so that it points to the following URL:%sYou can change this via %swebhook settings%s.', 'super-forms' ),
1190+
esc_html__( 'Please update your Webhook endpoint so that it points to the following URL:%sYou can change this via %swebhook settings%s.', 'super-forms' ),
11911191
'<br /><br /><code> ' . $home_url . 'sfstripe/webhook</code><br /><br />', // super forms stripe webhook e.g: https://domain.com/sfstripe/webhook will be converted into https://domain.com/index.php?sfstripewebhook=true
11921192
'<a target="_blank" href="https://dashboard.stripe.com/webhooks/' . $webhook['id'] . '">',
11931193
'</a>'

0 commit comments

Comments
 (0)