function add_fitzgraham_objects_and_taxonomy()
{
    add_new_object('Events');
    add_new_object('Partners');
    add_new_object('People');
    add_new_taxonomy('Status', array('People', 'Partners'));
    //add_new_object('Prices');
}
Exemple #2
0
function part_set_prop($properties, $start_pos)
{
    $start_time = time();
    $prod_id = array();
    for ($i = $start_pos; $i < count($properties); $i++) {
        if (item_exists($properties[$i]->No, $prod_id)) {
            //$date_exist = array_key_exists($properties[$i]->No, $date_mod);
            //if ($date_exist &&  $date_mod[$properties[$i]->No] <= $properties[$i]->Last_time_modified || !$date_exist) {
            $product_attributes = get_post_meta($prod_id[$properties[$i]->No], '_product_attributes', true);
            //if (!taxonomy_exists('pa_'.$properties[$i]->PropertyID)) {
            insert_attribute_wc($properties[$i]->PropertyID, $properties[$i]->PropertyName);
            add_new_taxonomy('pa_' . $properties[$i]->PropertyID, $properties[$i]->PropertyName);
            //}
            $product_attributes['pa_' . $properties[$i]->PropertyID] = array('name' => 'pa_' . $properties[$i]->PropertyID, 'is_visible' => 1, 'is_variation' => 0, 'is_taxonomy' => 1);
            update_post_meta($prod_id[$properties[$i]->No], '_product_attributes', $product_attributes);
            wp_set_object_terms($prod_id[$properties[$i]->No], $properties[$i]->Value, 'pa_' . $properties[$i]->PropertyID);
            //}
        }
        error_log(current_time('mysql') . " Added properties " . $i . ": " . $properties[$i]->No . ": " . $properties[$i]->PropertyName . " \r\n", 3, "connect.log");
        if (time() - $start_time > 25) {
            repeat_set_prop($properties, ++$i);
            break;
        }
    }
}
function add_fitzgraham_objects_and_taxonomy()
{
    add_new_object('Volunteer');
    add_new_object('Program');
    add_new_object('Books');
    add_new_taxonomy('Elements', 'Program');
    add_new_object('Artists');
    add_new_object('Events');
    add_new_object('Venues');
    add_new_object('Partners');
    add_new_object('People');
    add_new_taxonomy('Partners', array('People', 'Partners'));
    //add_new_object('Prices');
}