WordPress.org

Ready to get started?Download WordPress

Forums

Attachments
[resolved] little suggestion on class.attachment when saving (2 posts)

  1. Jerjerod
    Member
    Posted 1 year ago #

    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/

  2. Jonathan Christopher
    Member
    Plugin Author

    Posted 1 year ago #

    This has been updated in version 3.1.4, thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.