diff --git wp-includes/post.php wp-includes/post.php
index c4ce1af..fc3a372 100644
|
|
|
function get_page_statuses( ) { |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 | /** |
| 629 | | * Register a post type. Do not use before init. |
| | 629 | * Register a post status. Do not use before init. |
| 630 | 630 | * |
| 631 | 631 | * A simple function for creating or modifying a post status based on the |
| 632 | 632 | * parameters given. The function will accept an array (second optional |
| … |
… |
function register_post_status($post_status, $args = array()) { |
| 659 | 659 | $wp_post_statuses = array(); |
| 660 | 660 | |
| 661 | 661 | // Args prefixed with an underscore are reserved for internal use. |
| 662 | | $defaults = array('label' => false, 'label_count' => false, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => null, 'internal' => null, 'protected' => null, 'private' => null, 'show_in_admin_all' => null, 'publicly_queryable' => null, 'show_in_admin_status_list' => null, 'show_in_admin_all_list' => null, 'single_view_cap' => null); |
| 663 | | $args = wp_parse_args($args, $defaults); |
| 664 | | $args = (object) $args; |
| | 662 | $defaults = array( |
| | 663 | 'label' => false, |
| | 664 | 'label_count' => false, |
| | 665 | 'exclude_from_search' => null, |
| | 666 | '_builtin' => false, |
| | 667 | '_edit_link' => 'post.php?post=%d', |
| | 668 | 'public' => null, |
| | 669 | 'internal' => null, |
| | 670 | 'protected' => null, |
| | 671 | 'private' => null, |
| | 672 | 'show_in_admin_all' => null, |
| | 673 | 'publicly_queryable' => null, |
| | 674 | 'show_in_admin_status_list' => null, |
| | 675 | 'show_in_admin_all_list' => null, |
| | 676 | 'single_view_cap' => null |
| | 677 | ); |
| | 678 | |
| | 679 | $args = (object) wp_parse_args($args, $defaults); |
| 665 | 680 | |
| 666 | 681 | $post_status = sanitize_key($post_status); |
| 667 | 682 | $args->name = $post_status; |
| … |
… |
function register_post_status($post_status, $args = array()) { |
| 669 | 684 | if ( null === $args->public && null === $args->internal && null === $args->protected && null === $args->private ) |
| 670 | 685 | $args->internal = true; |
| 671 | 686 | |
| 672 | | if ( null === $args->public ) |
| | 687 | if ( null === $args->public ) |
| 673 | 688 | $args->public = false; |
| 674 | 689 | |
| 675 | | if ( null === $args->private ) |
| | 690 | if ( null === $args->private ) |
| 676 | 691 | $args->private = false; |
| 677 | 692 | |
| 678 | | if ( null === $args->protected ) |
| | 693 | if ( null === $args->protected ) |
| 679 | 694 | $args->protected = false; |
| 680 | 695 | |
| 681 | | if ( null === $args->internal ) |
| | 696 | if ( null === $args->internal ) |
| 682 | 697 | $args->internal = false; |
| 683 | 698 | |
| 684 | 699 | if ( null === $args->publicly_queryable ) |
| … |
… |
function register_post_type($post_type, $args = array()) { |
| 1040 | 1055 | } |
| 1041 | 1056 | |
| 1042 | 1057 | do_action( 'registered_post_type', $post_type, $args ); |
| 1043 | | |
| | 1058 | |
| 1044 | 1059 | return $args; |
| 1045 | 1060 | } |
| 1046 | 1061 | |
| … |
… |
add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' ); |
| 5308 | 5323 | |
| 5309 | 5324 | /** |
| 5310 | 5325 | * Update the custom taxonomies' term counts when a post's status is changed. For example, default posts term counts (for custom taxonomies) don't include private / draft posts. |
| 5311 | | * |
| | 5326 | * |
| 5312 | 5327 | * @access private |
| 5313 | 5328 | * @param string $new_status |
| 5314 | 5329 | * @param string $old_status |