| 1213 | | $args = (object) $args; |
| | 1213 | $args['name'] = sanitize_key( $post_type ); |
| | 1214 | /** |
| | 1215 | * Allow preprocessing of post type arguments. |
| | 1216 | * |
| | 1217 | * Empowers developers to: |
| | 1218 | * |
| | 1219 | * - Change visibility values or disable post types or provided by a plugin/theme |
| | 1220 | * not needed for a specific site. |
| | 1221 | * - Add new plugin/theme specific "supports" for default post types and |
| | 1222 | * custom post types that don't explicitly specify supports. |
| | 1223 | * - Add new plugin/theme specific values to support plugin/theme added features. |
| | 1224 | * For example, 'my_exporter' value could be set to information that the My Exporter |
| | 1225 | * plugin uses to implement an export such as columns to include, column labels, |
| | 1226 | * WP_Query args for default export as well as meta fields to include. |
| | 1227 | * - Disable default rewrite rule addition so customized rewrite rules could be added |
| | 1228 | * in a function called for the 'registered_post_type' hook. |
| | 1229 | * - Disable default metabox callback registration so customized metabox callback registration |
| | 1230 | * could be performed in a function called for the 'registered_post_type' hook. |
| | 1231 | * - Disable taxonomy registration for object so customized taxonomy registration for |
| | 1232 | * object could be performed in a function called for the 'registered_post_type' hook. |
| | 1233 | * |
| | 1234 | * @since 3.9.0 |
| | 1235 | * |
| | 1236 | * @param array|string $args See optional args description in function header above. |
| | 1237 | * @param string $post_type Post type key passed to register_post_type(), after |
| | 1238 | * sanitization. Should not exceed 20 characters. |
| | 1239 | */ |
| | 1240 | $args = apply_filters( 'register_post_type_args', $args, $post_type ); |
| | 1241 | if ( empty( $args ) ) { |
| | 1242 | return false; |
| | 1243 | } |