Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $wpdb;
- require('../../../wp-blog-header.php');
- if(isset($_POST)) {
- $nome = $_POST['nome'];
- $email = $_POST['email'];
- $statusPost = "draft";
- $query = "INSERT INTO $wpdb->posts (post_title, post_status, post_type) VALUES (%s, %s, %s)";
- $wpdb->query($wpdb->prepare($query, $nome, $statusPost, 'slug_cpt'));
- $postid = $wpdb->insert_id;
- update_post_meta($postid, '_email', $email);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement