manGoweb / MangoPress

(WordPress + Nette)²
35 stars 4 forks source link

metabox get_field for image type doesnt work #46

Closed hexcross closed 8 years ago

hexcross commented 8 years ago

If you use {$images = get_field(get_the_ID(), 'm_images')} it doesnt work correctly, this variable wasnt converted to array.

Quick solution: rwmb_meta( 'm_images', 'type=image&size=product_thumb' )

ViliamKopecky commented 8 years ago

Fixed in https://github.com/manGoweb/MangoPress/commit/b896a79fd5f278af389a26fb11660fa322ea7cdd

get_field (or alias meta) returns just the single value, if you have gallery, or other meta field with multiple values, use get_field_array or meta_array.