开发者

wordpress: how is the default category "uncategorized" inserted by default in the database

开发者 https://www.devze.com 2023-04-04 09:49 出处:网络
I am running a php cli script to pro grammatically post to a WordPress blog usingWordPress 3.2.1 and using only MySQL to do so. I bumped into a mystery. Even w开发者_StackOverflowhen I insert a post t

I am running a php cli script to pro grammatically post to a WordPress blog using WordPress 3.2.1 and using only MySQL to do so. I bumped into a mystery. Even w开发者_StackOverflowhen I insert a post touching only the *_posts table, a new entry is created to *_terms_relationships. How is that done? Is there some kind of MySQL procedure somewhere to automatically do that?

My script to insert a new post

INSERT INTO wp_posts (post_title,post_content,post_name,post_date,post_date_gmt,post_modified,post_modified_gmt,post_author,post_status) VALUES (:title,:post,'post_name',now(),now(),now(),now(),1,'publish')

how come this queries provokes a new row to be inserted in *_terms_relationships?


It's not a trigger included with the default Wordpress install (I just checked), maybe it's updated on a cron run?

0

精彩评论

暂无评论...
验证码 换一张
取 消