diff --git src/wp-includes/post.php src/wp-includes/post.php
index 85d0d16..d44b059 100644
|
|
function register_post_type( $post_type, $args = array() ) { |
1201 | 1201 | if ( ! is_array( $wp_post_types ) ) |
1202 | 1202 | $wp_post_types = array(); |
1203 | 1203 | |
| 1204 | // Sanitize post type name |
| 1205 | $post_type = sanitize_key( $post_type ); |
| 1206 | |
| 1207 | if ( empty( $args['_builtin'] ) ) { |
| 1208 | $args = apply_filters( 'register_post_type_args', $args, $post_type ); |
| 1209 | } |
| 1210 | |
1204 | 1211 | // Args prefixed with an underscore are reserved for internal use. |
1205 | 1212 | $defaults = array( |
1206 | 1213 | 'labels' => array(), |
… |
… |
function register_post_type( $post_type, $args = array() ) { |
1230 | 1237 | '_edit_link' => 'post.php?post=%d', |
1231 | 1238 | ); |
1232 | 1239 | $args = wp_parse_args( $args, $defaults ); |
1233 | | $args = (object) $args; |
1234 | 1240 | |
1235 | | $post_type = sanitize_key( $post_type ); |
| 1241 | $args = (object) $args; |
1236 | 1242 | $args->name = $post_type; |
1237 | 1243 | |
1238 | 1244 | if ( strlen( $post_type ) > 20 ) |