开发者

Missing includes in Wordpress plugin (wp_insert_post function)

I created a code开发者_运维百科 which generates content and I want to populate Wordpress's database with it. I am using wp_insert_post and add_post_meta functions but every time I load which triggers the script I get this error:

Fatal error: Call to undefined function add_action() in \www\scriptmafia\wp-includes\post.php on line 153

To my mind it due to some missing includes. I have included post.php which it mentioned as required include for wp_insert_post function.

I know this is pretty common among newbies in WordPress. However, any solution I have tried have not worked for me.


require_once( ABSPATH . '/wp-load.php'); should solve it :)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜