From f501616105792c8fd1b50223796fc4e56c763a6e Mon Sep 17 00:00:00 2001 From: Kevin Langley Date: Mon, 7 Jan 2013 10:55:23 -0500 Subject: [PATCH] checking if post id is false before getting post for selected rows and removing duplicate get_post_type_object call --- post-selection-ui.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post-selection-ui.php b/post-selection-ui.php index e2750a6..379be9f 100644 --- a/post-selection-ui.php +++ b/post-selection-ui.php @@ -170,8 +170,8 @@ public function render_addable_rows($wp_query) { $title = esc_html(get_the_title($post->ID)); $row_actions = ''; - $can_edit = current_user_can( get_post_type_object( get_post_type($post->ID) )->cap->edit_post, $post->ID ); $post_type_object = get_post_type_object( get_post_type($post->ID)); + $can_edit = current_user_can( $post_type_object->cap->edit_post, $post->ID ); if( $can_edit ) $row_actions .= sprintf('Edit | ', get_edit_post_link( $post->ID )); @@ -206,7 +206,7 @@ public function render_addable_rows($wp_query) { private function render_selected_rows($post_ids) { $output = ''; foreach($post_ids as $post_id) { - if(!get_post($post_id)) { + if(!$post_id || !get_post($post_id)) { continue; }