WC_Admin_Duplicate_Product::dupe_button PHP Méthode

dupe_button() public méthode

Show the dupe product link in admin.
public dupe_button ( )
        public function dupe_button()
        {
            global $post;
            if (!current_user_can(apply_filters('woocommerce_duplicate_product_capability', 'manage_woocommerce'))) {
                return;
            }
            if (!is_object($post)) {
                return;
            }
            if ('product' !== $post->post_type) {
                return;
            }
            if (isset($_GET['post'])) {
                $notify_url = wp_nonce_url(admin_url("edit.php?post_type=product&action=duplicate_product&post=" . absint($_GET['post'])), 'woocommerce-duplicate-product_' . $_GET['post']);
                ?>
			<div id="duplicate-action"><a class="submitduplicate duplication" href="<?php 
                echo esc_url($notify_url);
                ?>
"><?php 
                _e('Copy to a new draft', 'woocommerce');
                ?>
</a></div>
			<?php 
            }
        }