• I have looked around the forums quite a bit and am trying to learn if the following is possible and I feel like the terminology that I am using may be a barrier but am not certain. Here is what I am trying to determine is possible.

    I have a video player that stores various meta data on each video that is uploaded into such as title, description, etc. What I would like to do it populate the word press post fields based after feeding the post page a simple video ID.

    The basic functionality would be…

    1) add new post
    2) enter video ID into custom field
    3) hit some type of load button where it runs the query to grab data from mySQL database
    4) either the post can be created right then and the title, description, etc could be filled out OR my preference would be that using jquery/AJAX or something along those lines it would grab and dump those into each of the post fields and then I could edit accordingly and then manually publish.

    We have been able to connect the database and pull down and display information from the mySQL in a basic page template. Now we just need to be able to pull it into the post creation/edit page so that we can create those video posts.

    Just FYI, the post page will utilize the data grabbed from the database as well as the video ID to drop an embedded version of the player with the appropriate video details for that video. This allows us to use the built in features of WP like categorization, tagging, etc. to manage them all.

    Any insight into if this is a doable concept and how to start and go about it would be much appreciated. Thanks for any time spent reading and answering this post, it is much appreciated.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It seems the best way to pre-populate new posts is to have your code gather the data and format it as needed. Then the code creates and inserts a new post, getting the resulting post-ID. Then the user is redirected to wp-admin/post.php?post={post-ID}&action=edit where they can add to the already in place data.

Viewing 1 replies (of 1 total)
  • The topic ‘Populate Post Fields Via mySQL query’ is closed to new replies.