Esempio n. 1
0
function asp_update_index_table($post_id)
{
    if (wp_is_post_revision($post_id)) {
        return;
    }
    $it_options = get_option('asp_it_options');
    if ($it_options !== false) {
        $args = array();
        foreach ($it_options as $k => $o) {
            $args[str_replace('it_', '', $k)] = $o;
        }
        $it_o = new asp_indexTable($args);
        $post_status = get_post_status($post_id);
        if ($post_status == 'trash') {
            $it_o->removeDocument($post_id, true);
            return true;
        }
        $it_o->removeDocument($post_id);
        $it_o->indexDocument($post_id, true, true);
    }
}