Support » Plugin: PDF Image Generator » 1.5.6 breaks get_post_meta

  • After I upgrade to 1.5.6, something broken when I upload PDF via WP REST API. The error info is

    <b>Warning</b>: Illegal string offset ‘sizes’ in <b>/var/www/html/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php</b> on line <b>348</b><br />
    <b>Catchable fatal error</b>: Object of class stdClass could not be converted to string in <b>/var/www/html/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php</b> on line <b>348</b>

    I found that you serialize the data of post meta in the hook function pigen_wp_get_attachment_metadata() :

    serialize( get_post_meta( $thumbnail_id, ‘_wp_attachment_metadata’, true ) );

    Then the wp_get_attachment_metadata no longer return an array, it’s string instead. May I know why you did that?

  • The topic ‘1.5.6 breaks get_post_meta’ is closed to new replies.