Checkout: Filter – checkout_paymentmethod_title

Description

The checkout_paymentmethod_title filter will filter the title text of each payment method so that you can either change it or specify text for a custom payment method from it’s slug.

Eg. Your custom payment method is “mypmethod” and you want to display “My Payment Method” throughout the plugin to the customers and the merchant.

Usage

add_filter('checkout_paymentmethod_title', 'paymentmethod_title', 10, 2);

Arguments

  • $method – Any current text for the payment method.
  • $pmethod – The slug of the payment method eg. mypmethod

Example

function paymentmethod_title($method = null, $paymentmethod = true) {
    if (!empty($paymentmethod) && $paymentmethod == "mypmethod") {
        $method = $this -> title();
    }

    return $method;
}

function title() {
    $title = "Payments with My Payment Method";
    return $title;
}

add_filter('checkout_paymentmethod_title', 'paymentmethod_title', 10, 2);

WordPress Plugins

Start selling products, sending newsletters, publishing ads, and more through your own WordPress website using our premium WordPress plugins.

Browse

Pin It on Pinterest