Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_REQUEST['cars'])){ // checking which form is coming from post array
- $make = $_POST['make']; // getting the field from the form and pass it to a variable
- $new_post = array( // collecting the information about the new post
- 'post_title' => $title,
- 'post_content' => $description,
- 'tax_input' => array('types' => array('cars')),
- 'post_status' => 'pending',
- 'post_type' => 'vehicles'
- );
- $pid = wp_insert_post($new_post); // pass the array data from above to the function that actually save the post
- wp_set_object_terms($pid, 'cars', 'types', true); // setting the taxonomy for that specific post
- add_post_meta($pid, 'car_make', $make, true); // adding the meta information about the post. THIS IS WHAT I WANT TO APPEAR IN ADMIN EDIT MENU
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement