2

I've created a custom post type menu with register_post_type. I want to add a settings sub-menu with lots of options, including extra "Add option to a select list" button.

The problem: when using settings api, any <form> wants action="options.php". But that ends with a redirect to the edit.php address required when the sub menu is added to the custom post type menu. That means $_POST is lost by the time the code get back to the options page - so there is no way to see if those extra buttons were pressed.

Not using options.php for the <form> directs the submits directly to edit.php, where it dies with a permissions option. I'd prefer not to use JavaScript to fill in those dynamic settings. Any way to bypass the settings API and options.php, and get directly the edit.php but not get the permissions crash?

I looked at the source code, as well as tons of plugins with custom post type and a settings page, but they ALL use settings API via options.php - and that precludes getting an alternate submit button click back to the settings code. In this case, this is a severe limitation with the Settings API because the redirect at the end loses $_POST.

-2

For less of problems, you can use Advanced Custom Fields plugin for create a good options page , and custom fields into posts, pages, and so on.

Plase check it here:

http://www.advancedcustomfields.com/add-ons/options-page/ - Paid addon.

Plase see a video.

1
  • A link only answer is considered poor quality. If it's behind a paywall even more. – kaiser Jan 10 '14 at 6:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.