1. Home
  2. Knowledge Base
  3. Advanced Uploads for Add-Ons Ultimate
  4. Enable image editing for specific products
  1. Home
  2. Knowledge Base
  3. Advanced Topics for Advanced Uploads
  4. Enable image editing for specific products

Enable image editing for specific products

If you only want to enable image editing for some products, not all, then follow the steps below:

  • Leave the ‘Enable image editing’ setting unchecked
  • Add the following snippet
<?php
/**
* Enable image editing for certain products
*/
function prefix_enable_image_editing( $enabled ) {
$product_id = get_the_ID();
if( in_array( $product_id, array( 123, 456, 789 ) ) ) {
$enabled = 'yes';
}
return $enabled;
}
add_filter( 'wcpauau_image_editing_enabled', 'prefix_enable_image_editing' );
  • Update the snippet with IDs of the products that you want to have image editing enabled for

Here’s how to add a snippet

Was this article helpful?