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);

Website & Email Hosting

Get the best website & email hosting for speed, security, and peace of mind. No restrictions. Freedom to do what you need in order to run your business.

Host Now

Pin It on Pinterest

%d bloggers like this: