تابع ووکامرسی wc_get_page_id دریافت آیدی صفحاتی مثل shop , cart و …

تابع ووکامرسی wc_get_page_id – دریافت آیدی صفحاتی مثل shop , cart , view_order , checkout , myaccount
Syntax – سینتکس
(int) wc_get_page_id( (string) $page );
Parameters – پارامتر ها (1)
- 1- $page (string)
Usage – نحوه استفاده
if ( !function_exists( 'wc_get_page_id' ) ) { require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-page-functions.php'; } // The page. $page = ''; // NOTICE! Understand what this does before running. $result = wc_get_page_id($page);
Defined – محل تعریف
/includes/wc-page-functions.php
function wc_get_page_id( $page ) { if ( 'pay' == $page || 'thanks' == $page ) { wc_deprecated_argument( __FUNCTION__, '2.1', 'The "pay" and "thanks" pages are no-longer used - an endpoint is added to the checkout instead. To get a valid link use the WC_Order::get_checkout_payment_url() or WC_Order::get_checkout_order_received_url() methods instead.' ); $page = 'checkout'; } if ( 'change_password' === $page || 'edit_address' === $page || 'lost_password' === $page ) { wc_deprecated_argument( __FUNCTION__, '2.1', 'The "change_password", "edit_address" and "lost_password" pages are no-longer used - an endpoint is added to the my-account instead. To get a valid link use the wc_customer_edit_account_url() function instead.' ); $page = 'myaccount'; } $page = apply_filters( 'woocommerce_get_' . $page . '_page_id', get_option( 'woocommerce_' . $page . '_page_id' ) ); return $page ? absint( $page ) : -1; }
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر