diff --git src/wp-includes/post.php src/wp-includes/post.php
index 85d0d16..19acb7d 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 | |
| 1204 | 1207 | // Args prefixed with an underscore are reserved for internal use. |
| 1205 | 1208 | $defaults = array( |
| 1206 | 1209 | 'labels' => array(), |
| … |
… |
function register_post_type( $post_type, $args = array() ) { |
| 1230 | 1233 | '_edit_link' => 'post.php?post=%d', |
| 1231 | 1234 | ); |
| 1232 | 1235 | $args = wp_parse_args( $args, $defaults ); |
| 1233 | | $args = (object) $args; |
| 1234 | 1236 | |
| 1235 | | $post_type = sanitize_key( $post_type ); |
| | 1237 | if ( false == $args['_builtin'] ) { |
| | 1238 | $args = apply_filters( 'register_post_type_args', $args, $post_type ); |
| | 1239 | } |
| | 1240 | |
| | 1241 | $args = (object) $args; |
| 1236 | 1242 | $args->name = $post_type; |
| 1237 | 1243 | |
| 1238 | 1244 | if ( strlen( $post_type ) > 20 ) |