/**
 * Update Meta Boxes
 */
function spyropress_update_meta_box($fields, $post_ID, $meta_key = false)
{
    $settings = spyropress_update_settings($fields);
    if ($meta_key) {
        delete_post_meta($post_ID, $meta_key);
    } else {
        delete_all_post_meta($settings[2], $post_ID);
    }
    return $settings[0];
}
Пример #2
0
function sn_delete_post($id)
{
    global $sn_sql;
    $id = (int) $id;
    if ($id == 0) {
        return false;
    }
    $result = $sn_sql->query("DELETE FROM `posts` WHERE `id`={$id}");
    delete_all_post_meta($id);
    // delete his metas
    if (!$result) {
        return false;
    }
    return true;
}