function create( $args = array(), $update = false, $strip = true) { global $wf; $defaults = array( 'term_id' => crc32(uniqid()), 'term_group' => 0, 'taxonomy' => $this->name, 'description' => '', 'parent' => 0, 'count' => 0 ); $item = wp_parse_args( WOOF::remap_args($args, WOOF_Term::$aliases), $defaults ); $t = $wf->wrap_term( (object) $item ); $t->_is_new = true; $t->set_site_id( $this->_site_id ); if ($update) { return $t->update($strip); } return $t; }
function create( $args = array(), $update = false, $strip = true) { global $wf; global $user_ID; $defaults = array( 'ID' => crc32(uniqid()), 'post_status' => 'draft', 'post_type' => $this->name, 'post_name' => '', 'post_author' => $user_ID, 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0 ); $item = wp_parse_args( WOOF::remap_args($args, WOOF_Post::$aliases), $defaults ); $p = $wf->wrap_post( (object) $item ); $p->_is_new = true; $p->set_site_id( $this->_site_id ); if ($update) { return $p->update(); } return $p; }