Remove duplicate product link from WooCommerce Page Row Actions
Tweet Follow @3pixelssolution[php]
function my_duplicate_post_link($actions, $post) {
// The following checks WHERE we should run if not products just return
if ( $post->post_type != ‘product’ ) {
return $actions;
}
$product = get_product( $post->ID );
unset($actions[‘duplicate’]);
return $actions;
}
// Notice priority changed from default 10 to 15(anything greater than 10)
// Priority defines WHEN we should run
add_filter(‘post_row_actions’, ‘my_duplicate_post_link’, 15, 2);
add_filter(‘page_row_actions’, ‘my_duplicate_post_link’, 15, 2);
[/php]