From 716617804c00bd51da9253ffbf1afcbcc5273dfd Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 17 Oct 2012 13:09:17 +0000 Subject: [PATCH] Allow numbers in screen option IDs. Fixes setting posts per page for custom post types containing 0-9. Props SergeyBiryukov. fixes #18323 git-svn-id: https://develop.svn.wordpress.org/trunk@22253 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/misc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 666bfdbfc5..44703f321c 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -325,7 +325,7 @@ function set_screen_options() { $option = $_POST['wp_screen_options']['option']; $value = $_POST['wp_screen_options']['value']; - if ( !preg_match( '/^[a-z_-]+$/', $option ) ) + if ( $option != sanitize_key( $option ) ) return; $map_option = $option;