Permalink
Browse files

Check if get_post is empty instead of false in filter_admin_title [fixes

 #35]
  • Loading branch information...
1 parent cce04f6 commit c3148be94593fe95a71c250a26aa69d3dda510c9 @tlovett1 committed Feb 12, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 safe-redirect-manager.php
@@ -376,9 +376,16 @@ public function check_for_possible_redirect_loops() {
* @return string
*/
public function filter_admin_title( $title, $post_id = 0 ) {
- if ( ! is_admin() || false === ( $redirect = get_post( $post_id ) ) || $redirect->post_type != $this->redirect_post_type )
+ if ( ! is_admin() )
return $title;
+ $redirect = get_post( $post_id );
+ if ( empty( $redirect ) )
+ return $title;
+
+ if ( $redirect->post_type != $this->redirect_post_type )
+ return $title;
+
$redirect_from = get_post_meta( $post_id, $this->meta_key_redirect_from, true );
if ( ! empty( $redirect_from ) )
return $redirect_from;

0 comments on commit c3148be

Please sign in to comment.