Answers for "wordpress add new post programmatically"

PHP
0

wordpress add new post programmatically

$new_post = array(
'post_title' => 'My New Post',
'post_content' => 'Lorem ipsum dolor sit amet...',
'post_status' => 'publish',
'post_date' => date('Y-m-d H:i:s'),
'post_author' => $user_ID,
'post_type' => 'post',
'post_category' => array(0)
);
$post_id = wp_insert_post($new_post);
Posted by: Guest on January-05-2022

Code answers related to "wordpress add new post programmatically"

Browse Popular Code Answers by Language