使用MySQL添加导航菜单项

时间:2018-12-04 作者:Jim VanPetten

我想使用PHP将Wordpress nav菜单项插入MySQL。我不认为我可以使用wp\\u create\\u nav\\u menu(),因为我需要从类别中构建一个初步菜单(超过100只猫!)然后,较低级别的管理员可以修改/调整/优化。我不认为wp\\u create\\u nav\\u menu()实际上更新了MySQL数据库。

我当然能弄明白,但我只是想知道是否有人能给我一个先发制人的机会。

Update wp_posts 
Update wp_term_relationships
update wp_term_taxonomy
update wp_terms

set             "post_author" => 1, 
                "post_date" => \'2017-12-15 09:37:18\', 
                "post_date_gmt" => \'2017-12-15 09:37:18\', 
                "post_content" => \'\', 
                "post_title" => \'Storage\', 
                "post_excerpt" => \'\', 
                "post_status" => \'publish\', 
                "comment_status" => \'closed\', 
                "ping_status" => \'closed\', 
                "post_password" => \'\', 
                "post_name" => \'home-garden-kitchen\', 
                "to_ping" => \'\', 
                "pinged" => \'\', 
                "post_modified" => \'2018-12-03 14:29:13\', 
                "post_modified_gmt" => \'2018-12-03 20:29:13\', 
                "post_content_filtered" => \'\', 
                "post_parent" => 0, 
                "menu_order" => 97, 
                "post_type" => \'nav_menu_item\',     
                "post_mime_type" => \'\', 
                "comment_count" => 0
等等等等。。。

1 个回复
SO网友:Jim VanPetten

我的错,wp_create_nav_menu() 是否插入MySQL

相关推荐

错误:MySQL意外关闭。运行WordPress的XAMPP本地会议

我在本地配置了一个xampp来运行wordpress。在修复一些问题时,我一定做错了什么,因为最后,我被mysql数据库中的以下日志卡住了。2015-11-10 15:26:56 10fc InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_mal