Desarrollar software

Closed Posted 7 years ago Paid on delivery
Closed Paid on delivery

Hi, i need to create a funtion to add featured image also to gallery in a product using WP ALL IMPORT

From wp all import support gave me this:

add_action('pmxi_saved_post', 'update_gallery_ids', 10, 3);

function update_gallery_ids($id) {

$media = get_attached_media( 'image', $id );

foreach($media as $item){

$gallery_img = wp_get_attachment_url($item->ID);

add_post_meta( $id, 'wpcf-property-gallery', $gallery_img );

}

}

But doesnt work.

I need a quick fix.

PHP WordPress

Project ID: #11543569

About the project

3 proposals Remote project Active 7 years ago