Function Reference: geodir_set_post_status
Summary
Set post status of a post.
Global Values
- $wpdb
- (object) (required) WordPress Database object.
- Default: None
Package
GeoDirectory
Parameters
- $pid
- (int) (required) The post ID.
- Default: None
- $status
- (string) (required) Post status. Ex: draft, publish etc.
- Default: None
Change Log
Since: 1.0.0
Source File
geodir_set_post_status() is located in geodirectory-functions/post_functions.php [Line: 2146]
Source Code
function geodir_set_post_status($pid, $status) { if ($pid) { global $wpdb; $my_post = array(); $my_post['post_status'] = $status; $my_post['ID'] = $pid; $last_postid = wp_update_post($my_post); } }