prefix . 'posts'; $data = array( 'post_status' => 'publish' ); $where = array( 'post_title' => 'Privacy Policy', 'post_status' => 'draft', ); $wpdb->update( $table, $data, $where ); } /** * Publish and set Terms & Conditions page. */ function publish_terms_page() { global $wpdb; $table = $wpdb->prefix . 'posts'; $data = array( 'post_title' => 'Terms & Conditions', 'post_status' => 'publish', 'post_type' => 'page', 'post_author' => 1, ); $wpdb->replace( $table, $data ); update_option( 'woocommerce_terms_page_id', $wpdb->insert_id ); } /** * Unpublish Privacy Policy page. */ function unpublish_privacy_page() { global $wpdb; $table = $wpdb->prefix . 'posts'; $data = array( 'post_status' => 'draft' ); $where = array( 'post_title' => 'Privacy Policy', 'post_status' => 'publish', ); $wpdb->update( $table, $data, $where ); } /** * Delete Terms & Conditions page. */ function delete_terms_page() { global $wpdb; $table = $wpdb->prefix . 'posts'; $data = array( 'post_title' => 'Terms & Conditions' ); $wpdb->delete( $table, $data ); }