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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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