Dev Resources

  • Home
  • Reference
  • BuddyX Theme
  • Functions
  • Hooks
  • Classes
Filter by type:
Search
Browse: Home / Reference / Classes / WC_Shortcode_My_Account / WC_Shortcode_My_Account::add_payment_method()

WC_Shortcode_My_Account::add_payment_method()

Show the add payment method page.

Contents

  • Description
    • Source
  • Related
    • Uses
    • Used By
  • User Contributed Notes

Description #Description


Source #Source

File: includes/shortcodes/class-wc-shortcode-my-account.php

	public static function add_payment_method() {
		if ( ! is_user_logged_in() ) {
			wp_safe_redirect( wc_get_page_permalink( 'myaccount' ) );
			exit();
		} else {
			do_action( 'before_woocommerce_add_payment_method' );

			wc_get_template( 'myaccount/form-add-payment-method.php' );

			do_action( 'after_woocommerce_add_payment_method' );
		}
	}

Expand full source code Collapse full source code


Top ↑

Related #Related

Top ↑

Uses #Uses

Uses
Uses Description
includes/wc-core-functions.php: wc_get_template()

Get other templates (e.g. product attributes) passing attributes and including the file.

includes/wc-page-functions.php: wc_get_page_permalink()

Retrieve page permalink.

Top ↑

Used By #Used By

Used By
Used By Description
includes/wc-template-functions.php: woocommerce_account_add_payment_method()

My Account > Add payment method template.


Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

Proudly powered by WordPress