Desarrollar software

Geschlossen Veröffentlicht vor 7 Jahren Bezahlt bei Lieferung
Geschlossen Bezahlt bei Lieferung

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

Projekt-ID: #11543569

Über das Projekt

3 Vorschläge Remote Projekt Aktiv vor 7 Jahren