WordPress.org

Support

Support » Plugins and Hacks » [Resolved] little suggestion on class.attachment when saving

[Resolved] little suggestion on class.attachment when saving

  • Hi jonathan,
    Just a little suggestion for avoiding to store data in postmeta table when there is no attachments on a post :

    in class.attachments.php line 1144 add something like this before saving :

    if  (empty($attachments)){
       return $post_id;
    } else {
    // we're going to store JSON (JSON_UNESCAPED_UNICODE is PHP 5.4+)
    $attachments = version_compare( PHP_VERSION, '5.4.0', '>=' ) ? json_encode( $attachments, JSON_UNESCAPED_UNICODE ) : json_encode( $attachments );
    }

    thanks a lot for your work

    http://wordpress.org/extend/plugins/attachments/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] little suggestion on class.attachment when saving’ is closed to new replies.