content-cards icon indicating copy to clipboard operation
content-cards copied to clipboard

Grab data parsed and generate custom post with metadata?

Open dtygel opened this issue 8 years ago • 6 comments

Hi all, What if the parser already being used could populate a wp_post and its metadata? The way it would work would be the same as now: a button in tinymce where user can put an url. But after url is passed, the content, description and metadata could be populated with the data grabbed. So we would not have a simple card, but a full post.

dtygel avatar Sep 06 '16 14:09 dtygel

@dtygel Thanks for your comment. What do you see as the use case for this? Enumerating all the embeds on your site? I think that's a good use case but something like mirroring other sites content is outside of the scope of this particular plugin.

khromov avatar Sep 06 '16 15:09 khromov

@khromov I think this idea has some merit. Storing all that stuff as a CPT would allow us to make Content Cards work outside of post scope (in custom wp_editor instances, sidebar widgets, etc.), as we would not really be tied to the post id as we are now, when we are using post meta.

Edit: I think it sould be a 'hidden' cpt (not public, not searchable, no admin UI, etc).

ideag avatar Sep 06 '16 15:09 ideag

It could certainly be helpful for #67 and/or #69.

ideag avatar Sep 06 '16 15:09 ideag

Agreed, that would help out. It would be a bit more complex than the postmeta storage but certainly doable.

Another option would be to use options table for storage. It would certainly be less code. :cat:

khromov avatar Sep 06 '16 15:09 khromov

@khromov options table is another option, true. I'm not sure which would be more maintainable in the long run. I somehow feel that storing data in a more structured manner (CPT+meta fields) would be better in the long run. It might also help us to fix the image caching issues we are having (or at least give us an easy way to nuke all cached images on uninstall, as they would be attached to certain posts. :) P.S. I know feel is not a good argument here, but that's all I've got so far ;)

ideag avatar Sep 06 '16 15:09 ideag

Having a full structured custom post for each card would allow for interesting template functions and filtering by the metadata.

dtygel avatar Sep 06 '16 17:09 dtygel