• Resolved webslinger_cc

    (@webslinger_cc)


    I need to capture any graphics used in the post editor from the media library or wherever and store that information into an already created database table. Once the graphic has been added and the post has been either Save Draft or Published I need to save the image’s exif data into a separate table called “sights”.

    A simple <? php include ?> will do the trick as the included page runs great on its own. However when I insert it into the post.php page, the page quits working. BTW there is more than 1 post.php page.

    This is not a post php into a browser page (like so many plug-in(s) will do) but rather put image data created at the time a post is saved or published into a database table.
    Should be super simple but I have a “Can’t see the forest for the trees” syndrome.

    https://www.artandarchitecture-sf.com/wp-content/uploads/test4.php

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You don’t want to add includes into core WP files like post.php, any of them. (There’s 3 I know of) Doing so will eventually lead to trouble. You should be able to hook the filter ‘wp_insert_post_data’ from a plugin. You are passed the new or updated data before it is inserted. You could also get the current content in the DB if it exists to generate a diff (or php equivalent) so you know which exif data to remove as well as add. Of course, you would need to search the content to extract the src url from img tags.

    Thread Starter webslinger_cc

    (@webslinger_cc)

    <<You don’t want to add includes into core WP files >>.
    Not too practical for a professed open architecture program.
    I will see about the ‘wp_insert_post_data’ process or I will come up with something more realistic.

    Easy enough to create my own posting page, just thought I would work inside the bubble if possible.

    Thank you bcworkz for your prompt and helpful reply.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘include’ is closed to new replies.