Automattic\WooCommerce\Blocks\Domain\Services
CheckoutLink::add_checkout_link_endpoint
Add the checkout link endpoint.
Метод класса: CheckoutLink{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$CheckoutLink = new CheckoutLink(); $CheckoutLink->add_checkout_link_endpoint();
Код CheckoutLink::add_checkout_link_endpoint() CheckoutLink::add checkout link endpoint WC 11.3.0
public function add_checkout_link_endpoint() {
// get registered rewrite rules.
$rules = get_option( 'rewrite_rules', array() );
$regex = '^checkout-link$';
add_rewrite_rule( $regex, 'index.php?checkout-link=true', 'top' );
// maybe flush rewrite rules if it was not previously in the option.
if ( ! isset( $rules[ $regex ] ) ) {
\WC_Post_Types::flush_rewrite_rules();
}
}