Function Reference: geodir_update_poststatus

Summary

Update post status of a post.

Global Values

$wpdb
(object) (required) WordPress Database object.

Default: None

Package

GeoDirectory

Parameters

$new_status
(string) (required) New post status. Ex: draft, publish etc.

Default: None
$old_status
(string) (required) Old post status. Ex: draft, publish etc.

Default: None
$post
(object) (required) The post object.

Default: None

Change Log

Since: 1.0.0

Source File

geodir_update_poststatus() is located in geodirectory-functions/post_functions.php [Line: 2168]

Source Code

function geodir_update_poststatus($new_status, $old_status, $post)
{
    global $wpdb;

    $geodir_posttypes = geodir_get_posttypes();

    if (!wp_is_post_revision($post->ID) && in_array($post->post_type, $geodir_posttypes)) {

        geodir_change_post_status($post->ID, $new_status);
    }
}