Error message
-
I used Custom Post Type UI for a while and could create some custom post type in this site too. However, when I try to add new custom post type, I encounter following error message. Is there any way to fix this problem?
supplied for foreach() in …/public/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php on line 352
Warning: Cannot modify header information – headers already sent by (output started at …/public/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php:352) in …/public/wp-admin/includes/misc.php on line 1198
The page I need help with: [log in to see the link]
-
Have you provided labels at all? Asking because the line 352 spot is when we iterate over saved label values for the actual registration of the chosen post type.
You should have had to provide at least 2 labels for the post type itself.
Also, just in case, what post type slug did you register?
Thank you for the quick reply.
I provided plural labels and singular labels for every post type.
Also I registered article_car (and labels: Articles Car / Article Car).Here is the debug info.
https://www.dropbox.com/s/hgkw3d1zewumwfb/30290425_debug.zip?dl=0Just as a dumb luck chance, and assuming you’re able to navigate anywhere still, can you go in and hit save again on the post types? I know there are 8, but not asking to do anything else besides just re-save them.
It’s a bit curious that something didn’t save at minimum an empty array for you.
Hello. As you suggested, I tried re-saved existing post types, and every time I clicked save button, same error message appeared.
Thinking about some collapsed data, I deleted all existing post type and taxonomies (I have a backup of whole this site), then try to create a test post type. Error message appeared. Then, I deactivated and deleted this plug-in, reinstall latest version again, then tried to create new test post type. Still it showed error message.
I deleted this newly created test post type, and got the debug info. Here is the link:
https://www.dropbox.com/s/tkgdqruv7wzdzhy/20190427_debug.zip?dl=0I wish you can have some solution.
Hiroyuki
You’re still getting the error even without anything saved for your CPTUI settings? or did they go away once you removed everything?
Beyond that, I don’t have any sort of readymade solution or hotfix available, since it should be saving at LEAST an empty array for the label spots, last I checked. I do strive to avoid warnings/notices whenever possible.
Yes, once I clear re-installed CPTUI, error message is disappeared. However, when I tried to create new post type, it appeared again.
Here is the message:supplied for foreach() in …/public/wp-content/plugins/custom-post-type-ui/inc/post-types.php on line 1431
Warning: Invalid argument supplied for foreach() in …/public/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php on line 352
Warning: Cannot modify header information – headers already sent by (output started at …/public/wp-content/plugins/custom-post-type-ui/inc/post-types.php:1431) in …/public/wp-admin/includes/misc.php on line 1198
I am really unsure why you’re not getting all of the data that you should be, it’s quite honestly making me scratch my head.
Best guess I have at this point, at least with the latest errors shown, is somehow the $_POST global doesn’t somehow have all the data it should.
Here’s line 1431: https://github.com/WebDevStudios/custom-post-type-ui/blob/master/inc/post-types.php#L1431
It should at MINIMUM have an empty array based off of how I’ve long perceived form data being handled. I’m legitimately curious if there’s some plugin or piece of code in your site that is affecting the $_POST global before we can get to it.
The topic ‘Error message’ is closed to new replies.