WPFW

WPFW supports this item

Supported

121 comments found.

hello, when exporting the menu from the test site, it worked well (I think) but then trying to import it on production site, nothing gets imported. here is one of the menu content:—please help. need these menus transferred this weekend, otherwise, there’s no need for this plugin. thanks (great concept, it will save me a lot of time when it works. btw)

// FILE-INFO-START // menu-id: blog-main-menu; // data-type: sql; // FILE-INFO-END

// INSERT MENU $wpdb->query(“INSERT INTO ”.$wpdb->prefix.”terms (name, slug) VALUES (‘Blog Main Menu’, ‘blog-main-menu’)”); $new_menu_id = $wpdb->insert_id;

$wpdb->query("INSERT INTO ".$wpdb->prefix."term_taxonomy (term_id, taxonomy, count)
                                VALUES (".$new_menu_id.", 'nav_menu', 4)");                
$tti = $wpdb->insert_id;
$prev_post_id = array();
$post_info = array(
    "post_author" => 42, 
    "post_date" => '2015-05-06 09:53:35', 
    "post_date_gmt" => '2015-05-06 16:53:35', 
    "post_content" => ' ', 
    "post_title" => '', 
    "post_excerpt" => '', 
    "post_status" => 'publish', 
    "comment_status" => 'open', 
    "ping_status" => 'closed', 
    "post_password" => '', 
    "post_name" => '16918', 
    "to_ping" => '', 
    "pinged" => '', 
    "post_modified" => '2017-09-30 22:07:03', 
    "post_modified_gmt" => '2017-10-01 05:07:03', 
    "post_content_filtered" => '', 
    "post_parent" => 2, 
    "menu_order" => 3, 
    "post_type" => 'nav_menu_item',     
    "post_mime_type" => '', 
    "comment_count" => 0
);
$post_info_types = array(
    "%d", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%d", 
    "%d", 
    "%s",     
    "%s", 
    "%d" 
);            
$wpdb->insert($wpdb->prefix."posts", $post_info, $post_info_types);
$new_post_id = $wpdb->insert_id;
$prev_post_id[16918] = $new_post_id;
$wpdb->query("UPDATE ".$wpdb->prefix."posts SET
                                guid = '".str_replace("?p=16918", "?p=".$new_post_id, "https://www.druva.com/?p=16918")."'
                                    WHERE ID = ".$new_post_id);
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_type', 'taxonomy')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_menu_item_parent', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_object_id', '408')");
$post_meta_id = $wpdb->insert_id;
$check = $wpdb->get_results("SELECT ".$wpdb->prefix."terms.term_id FROM ".$wpdb->prefix."terms, ".$wpdb->prefix."term_taxonomy 
                                                                WHERE ".$wpdb->prefix."terms.slug = 'industry-insights' 
                                                                    AND ".$wpdb->prefix."term_taxonomy.taxonomy = 'category'
                                                                        AND ".$wpdb->prefix."term_taxonomy.term_id = ".$wpdb->prefix."terms.term_id");
if (!$check[0]->term_id) {
    $wpdb->query("INSERT INTO ".$wpdb->prefix."terms (name, slug) VALUES ('Industry Insights', 'industry-insights')");
    $new_term_id = $wpdb->insert_id;                             
    $wpdb->query("INSERT INTO ".$wpdb->prefix."term_taxonomy (term_id, taxonomy) VALUES (".$new_term_id.", 'category')");
$wpdb->query("UPDATE ".$wpdb->prefix."postmeta SET
            meta_value = '".$new_term_id."' 
                WHERE meta_id = ".$post_meta_id." 
                    AND meta_key = '_menu_item_object_id'");
}
else {
    $wpdb->query("UPDATE ".$wpdb->prefix."postmeta SET
                meta_value = '".$check[0]->term_id."' 
                    WHERE meta_id = ".$post_meta_id." 
                        AND meta_key = '_menu_item_object_id'");
}
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_object', 'category')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_target', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_classes', 'a:1:{i:0;s:0:\"\";}')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_xfn', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_url', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_is_naturalwidth', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_menuitembtn', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_loggedinvis', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_loggedoutvis', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_is_altstyle', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_hideheadings', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_megatitle', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_nocolumnspacing', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_icon', '')");
if($new_post_id) {
$wpdb->query("INSERT INTO ".$wpdb->prefix."term_relationships
                                (object_id, term_taxonomy_id)
                                VALUES 
                                (".$new_post_id.", ".$tti.")");
}
$post_info = array(
    "post_author" => 42, 
    "post_date" => '2015-05-06 09:53:35', 
    "post_date_gmt" => '2015-05-06 16:53:35', 
    "post_content" => ' ', 
    "post_title" => '', 
    "post_excerpt" => '', 
    "post_status" => 'publish', 
    "comment_status" => 'open', 
    "ping_status" => 'closed', 
    "post_password" => '', 
    "post_name" => '16919', 
    "to_ping" => '', 
    "pinged" => '', 
    "post_modified" => '2017-09-30 22:07:03', 
    "post_modified_gmt" => '2017-10-01 05:07:03', 
    "post_content_filtered" => '', 
    "post_parent" => 2, 
    "menu_order" => 4, 
    "post_type" => 'nav_menu_item',     
    "post_mime_type" => '', 
    "comment_count" => 0
);
$post_info_types = array(
    "%d", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%d", 
    "%d", 
    "%s",     
    "%s", 
    "%d" 
);            
$wpdb->insert($wpdb->prefix."posts", $post_info, $post_info_types);
$new_post_id = $wpdb->insert_id;
$prev_post_id[16919] = $new_post_id;
$wpdb->query("UPDATE ".$wpdb->prefix."posts SET
                                guid = '".str_replace("?p=16919", "?p=".$new_post_id, "https://www.druva.com/?p=16919")."'
                                    WHERE ID = ".$new_post_id);
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_type', 'taxonomy')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_menu_item_parent', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_object_id', '409')");
$post_meta_id = $wpdb->insert_id;
$check = $wpdb->get_results("SELECT ".$wpdb->prefix."terms.term_id FROM ".$wpdb->prefix."terms, ".$wpdb->prefix."term_taxonomy 
                                                                WHERE ".$wpdb->prefix."terms.slug = 'product-deep-dives' 
                                                                    AND ".$wpdb->prefix."term_taxonomy.taxonomy = 'category'
                                                                        AND ".$wpdb->prefix."term_taxonomy.term_id = ".$wpdb->prefix."terms.term_id");
if (!$check[0]->term_id) {
    $wpdb->query("INSERT INTO ".$wpdb->prefix."terms (name, slug) VALUES ('Product Deep-Dives', 'product-deep-dives')");
    $new_term_id = $wpdb->insert_id;                             
    $wpdb->query("INSERT INTO ".$wpdb->prefix."term_taxonomy (term_id, taxonomy) VALUES (".$new_term_id.", 'category')");
$wpdb->query("UPDATE ".$wpdb->prefix."postmeta SET
            meta_value = '".$new_term_id."' 
                WHERE meta_id = ".$post_meta_id." 
                    AND meta_key = '_menu_item_object_id'");
}
else {
    $wpdb->query("UPDATE ".$wpdb->prefix."postmeta SET
                meta_value = '".$check[0]->term_id."' 
                    WHERE meta_id = ".$post_meta_id." 
                        AND meta_key = '_menu_item_object_id'");
}
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_object', 'category')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_target', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_classes', 'a:1:{i:0;s:0:\"\";}')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_xfn', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_url', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_is_naturalwidth', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_menuitembtn', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_loggedinvis', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_loggedoutvis', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_is_altstyle', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_hideheadings', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_megatitle', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_nocolumnspacing', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_icon', '')");
if($new_post_id) {
$wpdb->query("INSERT INTO ".$wpdb->prefix."term_relationships
                                (object_id, term_taxonomy_id)
                                VALUES 
                                (".$new_post_id.", ".$tti.")");
}
$post_info = array(
    "post_author" => 42, 
    "post_date" => '2015-05-06 09:53:35', 
    "post_date_gmt" => '2015-05-06 16:53:35', 
    "post_content" => ' ', 
    "post_title" => '', 
    "post_excerpt" => '', 
    "post_status" => 'publish', 
    "comment_status" => 'open', 
    "ping_status" => 'closed', 
    "post_password" => '', 
    "post_name" => '16921', 
    "to_ping" => '', 
    "pinged" => '', 
    "post_modified" => '2017-09-30 22:07:03', 
    "post_modified_gmt" => '2017-10-01 05:07:03', 
    "post_content_filtered" => '', 
    "post_parent" => 2, 
    "menu_order" => 2, 
    "post_type" => 'nav_menu_item',     
    "post_mime_type" => '', 
    "comment_count" => 0
);
$post_info_types = array(
    "%d", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%d", 
    "%d", 
    "%s",     
    "%s", 
    "%d" 
);            
$wpdb->insert($wpdb->prefix."posts", $post_info, $post_info_types);
$new_post_id = $wpdb->insert_id;
$prev_post_id[16921] = $new_post_id;
$wpdb->query("UPDATE ".$wpdb->prefix."posts SET
                                guid = '".str_replace("?p=16921", "?p=".$new_post_id, "https://www.druva.com/?p=16921")."'
                                    WHERE ID = ".$new_post_id);
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_type', 'taxonomy')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_menu_item_parent', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_object_id', '411')");
$post_meta_id = $wpdb->insert_id;
$check = $wpdb->get_results("SELECT ".$wpdb->prefix."terms.term_id FROM ".$wpdb->prefix."terms, ".$wpdb->prefix."term_taxonomy 
                                                                WHERE ".$wpdb->prefix."terms.slug = 'druva-news' 
                                                                    AND ".$wpdb->prefix."term_taxonomy.taxonomy = 'category'
                                                                        AND ".$wpdb->prefix."term_taxonomy.term_id = ".$wpdb->prefix."terms.term_id");
if (!$check[0]->term_id) {
    $wpdb->query("INSERT INTO ".$wpdb->prefix."terms (name, slug) VALUES ('Druva News', 'druva-news')");
    $new_term_id = $wpdb->insert_id;                             
    $wpdb->query("INSERT INTO ".$wpdb->prefix."term_taxonomy (term_id, taxonomy) VALUES (".$new_term_id.", 'category')");
$wpdb->query("UPDATE ".$wpdb->prefix."postmeta SET
            meta_value = '".$new_term_id."' 
                WHERE meta_id = ".$post_meta_id." 
                    AND meta_key = '_menu_item_object_id'");
}
else {
    $wpdb->query("UPDATE ".$wpdb->prefix."postmeta SET
                meta_value = '".$check[0]->term_id."' 
                    WHERE meta_id = ".$post_meta_id." 
                        AND meta_key = '_menu_item_object_id'");
}
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_object', 'category')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_target', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_classes', 'a:1:{i:0;s:0:\"\";}')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_xfn', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_url', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_is_naturalwidth', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_menuitembtn', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_loggedinvis', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_loggedoutvis', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_is_altstyle', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_hideheadings', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_megatitle', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_nocolumnspacing', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_icon', '')");
if($new_post_id) {
$wpdb->query("INSERT INTO ".$wpdb->prefix."term_relationships
                                (object_id, term_taxonomy_id)
                                VALUES 
                                (".$new_post_id.", ".$tti.")");
}
$post_info = array(
    "post_author" => 73, 
    "post_date" => '2017-09-30 22:05:53', 
    "post_date_gmt" => '2017-10-01 05:05:53', 
    "post_content" => ' ', 
    "post_title" => '', 
    "post_excerpt" => '', 
    "post_status" => 'publish', 
    "comment_status" => 'closed', 
    "ping_status" => 'closed', 
    "post_password" => '', 
    "post_name" => '33740', 
    "to_ping" => '', 
    "pinged" => '', 
    "post_modified" => '2017-09-30 22:07:03', 
    "post_modified_gmt" => '2017-10-01 05:07:03', 
    "post_content_filtered" => '', 
    "post_parent" => 2, 
    "menu_order" => 1, 
    "post_type" => 'nav_menu_item',     
    "post_mime_type" => '', 
    "comment_count" => 0
);
$post_info_types = array(
    "%d", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%s", 
    "%d", 
    "%d", 
    "%s",     
    "%s", 
    "%d" 
);            
$wpdb->insert($wpdb->prefix."posts", $post_info, $post_info_types);
$new_post_id = $wpdb->insert_id;
$prev_post_id[33740] = $new_post_id;
$wpdb->query("UPDATE ".$wpdb->prefix."posts SET
                                guid = '".str_replace("?p=33740", "?p=".$new_post_id, "https://www.druva.com/?p=33740")."'
                                    WHERE ID = ".$new_post_id);
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_type', 'taxonomy')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_menu_item_parent', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_object_id', '985')");
$post_meta_id = $wpdb->insert_id;
$check = $wpdb->get_results("SELECT ".$wpdb->prefix."terms.term_id FROM ".$wpdb->prefix."terms, ".$wpdb->prefix."term_taxonomy 
                                                                WHERE ".$wpdb->prefix."terms.slug = 'customers-stories' 
                                                                    AND ".$wpdb->prefix."term_taxonomy.taxonomy = 'category'
                                                                        AND ".$wpdb->prefix."term_taxonomy.term_id = ".$wpdb->prefix."terms.term_id");
if (!$check[0]->term_id) {
    $wpdb->query("INSERT INTO ".$wpdb->prefix."terms (name, slug) VALUES ('Customers Stories', 'customers-stories')");
    $new_term_id = $wpdb->insert_id;                             
    $wpdb->query("INSERT INTO ".$wpdb->prefix."term_taxonomy (term_id, taxonomy) VALUES (".$new_term_id.", 'category')");
$wpdb->query("UPDATE ".$wpdb->prefix."postmeta SET
            meta_value = '".$new_term_id."' 
                WHERE meta_id = ".$post_meta_id." 
                    AND meta_key = '_menu_item_object_id'");
}
else {
    $wpdb->query("UPDATE ".$wpdb->prefix."postmeta SET
                meta_value = '".$check[0]->term_id."' 
                    WHERE meta_id = ".$post_meta_id." 
                        AND meta_key = '_menu_item_object_id'");
}
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_object', 'category')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_target', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_classes', 'a:1:{i:0;s:0:\"\";}')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_xfn', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_url', '')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_is_naturalwidth', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_menuitembtn', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_loggedinvis', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_loggedoutvis', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_is_altstyle', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_hideheadings', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_megatitle', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_nocolumnspacing', '0')");
$wpdb->query("INSERT INTO ".$wpdb->prefix."postmeta 
                        (post_id, meta_key, meta_value)
                         VALUES 
                         (".$new_post_id.", '_menu_item_icon', '')");
if($new_post_id) {
$wpdb->query("INSERT INTO ".$wpdb->prefix."term_relationships
                                (object_id, term_taxonomy_id)
                                VALUES 
                                (".$new_post_id.", ".$tti.")");
}                                            
$wpdb->query("UPDATE ".$wpdb->prefix."posts SET
                                post_name = '".$prev_post_id[16918]."' 
                                    WHERE ID = ".$prev_post_id[16918]);
$wpdb->query("UPDATE ".$wpdb->prefix."posts SET
                                post_name = '".$prev_post_id[16919]."' 
                                    WHERE ID = ".$prev_post_id[16919]);
$wpdb->query("UPDATE ".$wpdb->prefix."posts SET
                                post_name = '".$prev_post_id[16921]."' 
                                    WHERE ID = ".$prev_post_id[16921]);
$wpdb->query("UPDATE ".$wpdb->prefix."posts SET
                                post_name = '".$prev_post_id[33740]."' 
                                    WHERE ID = ".$prev_post_id[33740]);
//wp_redirect(get_bloginfo("wpurl")."/wp-admin/nav-menus.php?action=edit&menu=".$new_menu_id);
WPFW

WPFW Author

I refunded. But can you pls trim this comment somehow. It’s quite big.

thank you. maybe this can help https://www.pastiebin.com/59fe10799a7b4

the code is what your plugin exported out. If we can make it work, i’ll pay for the extension. I would love to use it for all my projects. thanks

by
by
by
by
by
by