Automattic\WooCommerce\Internal\StockNotifications
Notification::get_product_permalink
Get product link.
Метод класса: Notification{}
Хуков нет.
Возвращает
string.
Использование
$Notification = new Notification(); $Notification->get_product_permalink();
Код Notification::get_product_permalink() Notification::get product permalink WC 11.3.0
public function get_product_permalink() {
$product = $this->get_product();
if ( ! $product || ! $product->get_id() ) {
return '';
}
$posted_attributes = $this->get_meta( 'posted_attributes' );
if ( ! $product instanceof \WC_Product_Variation || empty( $posted_attributes ) || ! is_array( $posted_attributes ) ) {
return (string) $product->get_permalink();
}
return (string) $product->get_permalink( array( 'variation' => $this->get_variation_attributes_with_posted_data( $product ) ) );
}