gform_mollie_payment_method_label

Description

Modify the Payment Method label when creating a Mollie field.

Usage

Applies to all forms:

add_filter( 'gform_mollie_payment_method_label, 'your_function_name', 10, 2 );

Applies to a specific form. In this case, form id 5.

add_filter( 'gform_mollie_payment_method_label_5', 'your_function_name', 10, 2 );

Parameters

ParameterTypeDescription
$labelstringThe label to be filtered.
$form_idintThe current form ID.

Examples

Change the Mollie field label.

add_filter( 'gform_mollie_payment_method_label', function( $label, $form_id ) {
	
	gf_mollie()->log_debug( 'gform_mollie_payment_method_label(): running.' );
	return 'Select Payment Processor';

}, 10, 2 );

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Since

Added in Mollie 1.0

Source Code

json_encode(
    gf_apply_filters(
        array( 'gform_mollie_payment_method_label', rgget( 'id' ) ),
        esc_html__( 'Payment Method', 'gravityformsmollie' ),
        rgget( 'id' )
    ),
    $default_payment_method
) . PHP_EOL;

This filter is located in GF_Field_Mollie::get_form_editor_inline_script_on_page_render() in class-gf-field-mollie.php.