Forum Replies Created

Viewing 46 replies (of 46 total)
  • cjhaas

    (@chrisvendiadvertisingcom)

    I’ve got the same problem and have traced it a little further. I think it has to do with deleted users in general and not just the first user. The problem appears to be in core.

    /wp-includes/author-template.php – line 73:

    $last_user = get_userdata($last_id);

    In my case $last_id is 4 which is a user that was deleted. The next line never checks if get_userdata() returns false and blindly uses a property on it. I’ve patched my local install by adding this to the CMS TPV functions file and changing line 1246 to use it instead.

    function cms_tpv_get_the_modified_author() {
    	if ( $last_id = get_post_meta( get_post()->ID, '_edit_last', true) ) {
    		$last_user = get_userdata($last_id);
    		if( $last_user !== false ){
    			return apply_filters('the_modified_author', $last_user->display_name);
    		}
    	}
    }
Viewing 46 replies (of 46 total)