我以编程方式在我的 WordPress 项目中添加了一些页面。为此,我正在使用wp_insert_post()函数。但是,这很好用。这些页面将自动添加到菜单中。对于其中一些很好,但我不想在那里添加的页面之一。
有没有办法在不手动删除的情况下防止这种情况发生。我正在考虑在创建页面后将其从菜单中删除,但我真的不知道如何,也许有更好/更简单的方法来做到这一点?
我创建页面的代码是:
$inschrijfbevestiging = array(
'post_title' => 'Inschrijfbevestiging',
'post_content' => '[inschrijfbevestiging]',
'post_status' => 'publish',
'post_type' => 'page'
);
wp_insert_post($inschrijfbevestiging);