WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Admin_Duplicate_Product::duplicate_product_action() public WC 1.0

Duplicate a product action.

Это метод класса: WC_Admin_Duplicate_Product{}

Хуки из метода
Возвращает

Null. Ничего.

Использование

$WC_Admin_Duplicate_Product = new WC_Admin_Duplicate_Product();
$WC_Admin_Duplicate_Product->duplicate_product_action();

Код WC_Admin_Duplicate_Product::duplicate_product_action() WC 4.5.2

woocommerce/includes/admin/class-wc-admin-duplicate-product.php
<?php
public function duplicate_product_action() {
	if ( empty( $_REQUEST['post'] ) ) {
		wp_die( esc_html__( 'No product to duplicate has been supplied!', 'woocommerce' ) );
	}

	$product_id = isset( $_REQUEST['post'] ) ? absint( $_REQUEST['post'] ) : '';

	check_admin_referer( 'woocommerce-duplicate-product_' . $product_id );

	$product = wc_get_product( $product_id );

	if ( false === $product ) {
		/* translators: %s: product id */
		wp_die( sprintf( esc_html__( 'Product creation failed, could not find original product: %s', 'woocommerce' ), esc_html( $product_id ) ) );
	}

	$duplicate = $this->product_duplicate( $product );

	// Hook rename to match other woocommerce_product_* hooks, and to move away from depending on a response from the wp_posts table.
	do_action( 'woocommerce_product_duplicate', $duplicate, $product );
	wc_do_deprecated_action( 'woocommerce_duplicate_product', array( $duplicate->get_id(), $this->get_product_to_duplicate( $product_id ) ), '3.0', 'Use woocommerce_product_duplicate action instead.' );

	// Redirect to the edit screen for the new draft page.
	wp_redirect( admin_url( 'post.php?action=edit&post=' . $duplicate->get_id() ) );
	exit;
}