Changeset 14086
- Timestamp:
- 04/14/2010 02:07:48 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-comments-post.php
r13200 r14086 20 20 $comment_post_ID = isset($_POST['comment_post_ID']) ? (int) $_POST['comment_post_ID'] : 0; 21 21 22 $ status = $wpdb->get_row( $wpdb->prepare("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID));22 $post = get_post($comment_post_ID); 23 23 24 if ( empty($ status->comment_status) ) {24 if ( empty($post->comment_status) ) { 25 25 do_action('comment_id_not_found', $comment_post_ID); 26 26 exit; 27 27 } 28 28 29 $status_obj = get_post_status_object($status->post_status); 29 // get_post_status() will get the parent status for attachments. 30 $status = get_post_status($post); 31 32 $status_obj = get_post_status_object($status); 30 33 31 34 if ( !comments_open($comment_post_ID) ) { 32 35 do_action('comment_closed', $comment_post_ID); 33 36 wp_die( __('Sorry, comments are closed for this item.') ); 34 } elseif ( 'trash' == $status ->post_status) {37 } elseif ( 'trash' == $status ) { 35 38 do_action('comment_on_trash', $comment_post_ID); 36 39 exit; … … 65 68 } 66 69 } else { 67 if ( get_option('comment_registration') || 'private' == $status ->post_status)70 if ( get_option('comment_registration') || 'private' == $status ) 68 71 wp_die( __('Sorry, you must be logged in to post a comment.') ); 69 72 } -
trunk/wp-includes/post.php
r14071 r14086 116 116 '_builtin' => true, /* internal use only. */ 117 117 'label_count' => _n_noop('Auto-Draft <span class="count">(%s)</span>', 'Auto-Drafts <span class="count">(%s)</span>') 118 ) ); 119 120 register_post_status( 'inherit', array( 'label' => _x('Inherit', 'post'), 121 'internal' => true, 122 '_builtin' => true, /* internal use only. */ 123 'label_count' => _n_noop('Inherit <span class="count">(%s)</span>', 'Inherit <span class="count">(%s)</span>') 118 124 ) ); 119 125 }
Note: See TracChangeset
for help on using the changeset viewer.