Add woocommerce filter after ajax function [closed]

Below is my function which runs on ajax and it upload image in media, now i want to add this in my woocomerrce cart but it does not work.

here $cart_item_meta returns path of the file in array.

function my_action_callback(  ){

            $addon_id = array();

            if( isset($_FILES) ){

$attach_info=wp_upload_bits($_FILES["file"]["name"], null, file_get_contents($_FILES["file"]["tmp_name"]));

$attach_id = wp_insert_attachment($data, $attach_info['file'], 0);

                $addon_id['media_id'] = $attach_id;
                $addon_id['media_url'] = wp_get_attachment_url( esc_attr( $attach_id ) );
                $cart_item_meta['wau_addon_ids'][] = $addon_id;

            add_filter( 'woocommerce_add_cart_item_data', $cart_item_meta, 10, 2 );


Go to Source
Author: Vishal

Plugin wp-offload-media stopped working

I’ve just noticed that the plugin wp-offload-media has stopped working in my WP page. It stopped uploading to AWS but uploads to where the WP install is. How to debug it? I’m not experienced at WordPress at all.

Update: I’ve checked if the AWS key/secret worked – it still works.

Go to Source
Author: haxpanel