Settings API with Sub-pages removes content from other pages

[ad_1]

So I’ve used this generator to create the bones of my admin page builder:

[https://wpturbo.dev/generators/settings-page/](https://wpturbo.dev/generators/settings-page/)

And I’ve modified it so I can use it to create pages & sub-pages:

[https://github.com/Amias-Burrows/options-page-creator](https://github.com/Amias-Burrows/options-page-creator)

I’ve got it working perfectly, it creates the pages, saves content that I can call in other parts of the code. The only issue is when I save content to one page (e.g. the root page) and then save some content onto the other page (e.g. Danger Zone), as you would with a setup like this, it removes the content that had been saved in the other page. I am under the impression it’s linked with the `register_setting()` line but I don’t know how to repair that issue unfortunately.

If anyone can spot a fix that would be amazing! I’ve been scratching my head over this for hours

Here is a link to a picture of the pages I’m referring to in the menu of my WordPress installation:

[https://imgur.com/a/2xILvEO](https://imgur.com/a/2xILvEO)

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer