Reputation: 2329
I have developed a plugin for creating automatic page which containing the following code:
$new_page = array(
'slug' => $_REQUEST[sl_store],
'title' => $_REQUEST[sl_store],
'content' => "$_REQUEST[sl_store] <br> $_REQUEST[sl_address]"
);
$new_page_id = wp_insert_post( array(
'post_title' => $new_page['title'],
'post_type' => 'page',
'post_name' => $new_page['slug'],
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => $new_page['content'],
'post_status' => 'publish',
'post_author' => 1
));
The page is creating fine. However, I need to fetch the "GUID" value for the newly created page from the DB.
Can anyone help me?
Upvotes: 0
Views: 1302