SQL script for publishing
-
So I am running into some issues here with auto publishing. I am mimic the process that accure once the Publish button is pressed with an SQL script.
A bit of backstory:
I have a site that it is feed posts from feedly. By default these posts are put into draft mode. Using the following script, I have figured out a way to change the post from draft to publish.
UPDATE DB_Name.wp_posts SET post_status = replace(post_status, ‘draft’, ‘publish’), post_name=id where post_status = ‘draft’;This works great and does switch from draft to publish and does assign a slug. However, when a post comes from feedly, it does not create a featured image. To do this, I have installed a plugin (Quick Featured Images Pro). The plugin basically scans the post and uses the first image it sees as the featured image.
Here is the catch. The plugin only works if you the feedly post is set to draft first and then you manually login and click publish. Thus, my script only makes the chagnes in the database, but does not fully do what I need.
So my question would be, does anyone know how to script (php or sql) the process of pushing the publish botton? Or better yet, how to run the plugin script after my script above is run?
Thanks in advance.
- The topic ‘SQL script for publishing’ is closed to new replies.