Opened 13 years ago
Closed 12 years ago
#18323 closed defect (bug) (fixed)
Screen Options "Show on Screen [n] Posts" for custom post type containing digits in its name does not work
Reported by: | vtowel | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.2.1 |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | Cc: |
Description
- In a plugin, write the code to register a custom post type called "all_in_1_event", or any other name that contains a digit.
- On the manage screen for that custom post type, reveal the Screen Options.
- Enter a new value for the "Show on Screen [n] Posts" field, something other than the default value of 20.
- Click "Apply".
- Reveal the Screen Options again.
- The new value has not been saved.
It seems to be that this is because of a check that occurs in the set_screen_options() function (misc.php, line 331). The option name is not allowed to contain digits - only letters, dashes and underscores - and I don't understand why. Our custom post type does contain a digit, and it has never been a problem for us before - except for saving the Screen Options.
Attachments (2)
Change History (12)
#4
@
13 years ago
I am using a custom post type named 'class-notes' (notice there are no digits in that label; just letters and a dash), and am experiencing the same issue in WordPress 3.2.1 and the latest nightly build of WordPress 3.3.
#5
@
13 years ago
the glitch is confirmed here too, post type 'feed-posts', perhaps it happens for any post type with a dash in it?
#6
@
12 years ago
- Component changed from Validation to Post Types
- Milestone changed from Awaiting Review to 3.5
#8
@
12 years ago
18323.2.patch uses sanitize_key()
.
Related: #18559