Support » Plugin: WP Document Revisions » Notice: Trying to get property of non-object in on line 1369

  • Resolved simonhayre

    (@simonhayre)


    Got this

    Notice: Trying to get property of non-object in /wp-content/plugins/wp-document-revisions/wp-document-revisions.php on line 1369

    Found this issue here:

    function add_revision_num_to_title( $title ) {
    		global $post;
    
    		//verify post type
    		if (!$this->verify_post_type() )
    			return $title;
    
    		//if this is a document, and not a revision, just filter and return the title
    		if ($post->post_type != 'revision' ) {
    
    			if ( is_feed() )
    				$title = sprintf( __( '%s - Latest Revision', 'wp-document-revisions'), $title );
    
    			return apply_filters( 'document_title',  $title );
    
    		}

    Can we change to this….?

    function add_revision_num_to_title( $title ) {
    		global $post;
    
    		//verify post type
    		if (!$post || !$this->verify_post_type() )
    			return $title;
    
    		//if this is a document, and not a revision, just filter and return the title
    		if ($post->post_type != 'revision' ) {
    
    			if ( is_feed() )
    				$title = sprintf( __( '%s - Latest Revision', 'wp-document-revisions'), $title );
    
    			return apply_filters( 'document_title',  $title );
    
    		}

    http://wordpress.org/extend/plugins/wp-document-revisions/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Notice: Trying to get property of non-object in on line 1369’ is closed to new replies.