wordpress insert post data and custom fields

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 […]

View Post

how to use ajax in wordpress

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 […]

View Post