Proper way to create a 'add new page' function
-
The idea is for logged in users to add pages, without accessing the backend.
This might be backwards, but thats why im posting it here. I’m wondering if anyone can help with with this code:
createnewpage.php
<?php $newTitle = $_POST['title']; $newContent = $_POST['content']; wp_insert_post($post) $post = array( 'post_author' = $user_ID, 'post_content' => $newContent, 'post_name' => $newTitle, 'post_status' => 'publish', 'post_title' => $newTitle, 'post_type' => 'page', 'post_parent' => 0, 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', ); ?>
JQuery Pop-up would contain this:
<html><body> <h1>Add A Page</h1> <form action="createnewpage.php" method="post"> <input name="title" type="text" /> <textarea name="content" type="text" /></textarea> <input type="submit" /> </form> </body></html>
But its wrong ??
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Proper way to create a 'add new page' function’ is closed to new replies.