Simple 3 steps: 1. create post basic values array of data $my_post = array( ‘post_title’ => $_SESSION[‘booking-form-title’], ‘post_date’ => $_SESSION[‘cal_startdate’], ‘post_content’ => ‘This is my post.’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘booking’, ); 2 insert post data and get returned post id $the_post_id = wp_insert_post( $my_post ); 3. use same returned post id to add […]
There are few simple steps to use ajax in wordpress: – ajax calling template/page file element (button / link) – ajax calling and response handler script in js/jqery – wordpress hooks defined to handle ajax functions – php function file to define functions to operate. Files used in wordpress: – any template file or page […]