Hoping this a an easy thing for you to answer.
I’m trying to set the cropping_preset on a per product basis inside the inc/files.php function ppom_uploaded_file_preview so they can used by the call to launch_aviary_editor, and I’m hitting a little problem of how to pass the variables.
I understand that I need to have the variables exposed inside
inc/files.php : function ppom_upload_file() {
What is the best way pass then under the $_REQUEST[‘settings’] , or is there another method for doing this?
Original I thought I could just extend the public Files and add an option array to ppom_uploaded_file_preview. But the info is never passed. If I try to call the Woocommerce $product objects inside ppom_upload_file then moxie.js dies. So that’s where I am.
//THIS IS what I wanted to do
public function File( $args, $default_files = ” ) {
//FIXME not passing ibx -mgt
global $product;
$ibx = array();
$product_id = $product->get_id();
$ibx_height = $product->get_height();
$ibx_width = $product->get_length();
$ibx[‘product_id’] = $product_id;
$ibx[‘ibx_height’] = $ibx_height;
$ibx[‘ibx_width’] = $ibx_width;
.
.
.
$file_preview = ppom_uploaded_file_preview($file[‘org’], $args, $ibx);