Hi,
I'm using a Meta-box custom table for one of my post-types which is working fine for most of it, the problem I have is with retrieving the image data.
For the images, I use a custom upload_dir I'm not able to get the image data, I get the database field data 'a:1:{i:0;s:81:"https://wp-plugin.test/wp-content/uploads/events/images/main/test-image.jpg";}' but I can not get it decoded. It works fine if I use the media folder.
function get_event_meta($event_id){
global $wpdb;
$table = EVENT_TABLE_NAME;
$event_id = get_the_ID();
$event_query = $wpdb->prepare("SELECT * FROM $table WHERE id=%s;", $event_id );
$event = $wpdb->get_row( $event_query, ARRAY_A );
$event['main_image'] = rwmb_meta( 'image_main', EVENT_TABLE_ARG, $event_id);
return $event;
}
Any insight on what I do wrong?