printf(__('Default: <code>%s</code>.', 'pronamic_ideal'), __('Pay', 'pronamic_ideal')); // WPCS: xss OK ?> </p> <p> <?php esc_html_e('Payment Method', 'pronamic_ideal'); ?> : <select class="jPronamicIdealPaymentMethodShortcode"> <option value=""><?php echo esc_html_x('All available methods', 'Payment method field', 'pronamic_ideal'); ?> </option> <?php $methods = Pronamic_WP_Pay_PaymentMethods::get_payment_methods(); foreach ($methods as $method => $name) { printf('<option value="%s">%s</option>', esc_attr($method), esc_html($name)); } ?> </select> </p> </td> </tr> <tr> <th><?php esc_html_e('Shortcode', 'pronamic_ideal'); ?> </th> <td>
/** * Editor JavaScript default field values. * * @see https://github.com/wp-premium/gravityforms/blob/2.0.3/js.php#L587-L599 * @see https://github.com/wp-premium/gravityforms/blob/2.0.3/js/forms.js#L38-L43 */ static function editor_js_set_default_values() { ?> case '<?php echo esc_js(self::TYPE); ?> ' : if ( ! field.label ) { field.label = '<?php echo esc_js(__('Choose a payment method', 'pronamic_ideal')); ?> '; } field.enableChoiceValue = true; if ( ! field.choices ) { field.choices = new Array(); <?php foreach (Pronamic_WP_Pay_PaymentMethods::get_payment_methods() as $value => $label) { ?> var choice = new Choice( <?php echo json_encode($label); ?> , <?php echo json_encode($value); ?> ); choice.isSelected = true; choice.builtin = true; field.choices.push( choice ); <?php } ?> } break; <?php }