jchristopher / attachments

[WordPress Plugin] Attachments allows you to simply append any number of items from your WordPress Media Library to Posts, Pages, and Custom Post Types
wordpress.org/extend/plugins/attachments/
GNU General Public License v2.0
239 stars 78 forks source link

change the serialization engine from json to wordpress core serialization #90

Closed stuk88 closed 11 years ago

stuk88 commented 11 years ago

there is no need to save array as json - wordpress serializes the arrays upon save and unserializes them upon load...

didn't know that... and after using couple of times the meta engine came to understand that my previous fix not addressing the problem at its core.. there is no need for json_encode and json_decode

jchristopher commented 11 years ago

Using JSON was intentional, even though WordPress serializes the array I've become tired of handling support tickets when a field contains a URL that changes when someone launches a site and in doing so does a find/replace on the database which in turn breaks the serialization completely. JSON avoids that issue.

I'm still evaluating saving Attachments data as separate postmeta records entirely but am wrapping my head around the reach of that switch because it will effect quite a bit.

stuk88 commented 11 years ago

yea its quite an operation...

2013/6/25 Jonathan Christopher notifications@github.com

Using JSON was intentional, even though WordPress serializes the array I've become tired of handling support tickets when a field contains a URL that changes when someone launches a site and in doing so does a find/replace on the database which in turn breaks the serialization completely. JSON avoids that issue.

I'm still evaluating saving Attachments data as separate postmeta records entirely but am wrapping my head around the reach of that switch because it will effect quite a bit.

— Reply to this email directly or view it on GitHubhttps://github.com/jchristopher/attachments/pull/90#issuecomment-19945904 .