wp_insert_posts are not shown in wp-admin, all posts section

265 views Asked by At

I have multi-site enabled WordPress installation into Amazon server with WPML installation too so I tried this and this, but I had no luck.

wp_insert_post(array('post_title'=>'test_title','post_content'=>'test_content', 'post_excerpt'=>'test_excerpt', 'post_type'=>'post', 'post_status'=>'publish'));

It successfully inserts post into wp_posts table but not being listed into dashboard admin section, however it works good into local server but not working into Amazon server.

The posts inserted shows as count into the admin section but not being shown into "All Posts" section.

I have same setup into another server than Amazon where above code works.

I see that when I deactivate the WPML plugin and then everything is working fine.
Do I have to add anything else into code above to make it work?

0

There are 0 answers