Changing a page title while the page is being built

It seems that the way you attached your function to the document_title_parts filter is wrong. As per WordPress documentation, document_title_parts only accepts one parameters, array $title. So it doesn’t make sense that when you have 2 parameters in your function.

I suggest you do something like this:

function custom_document_title( $title_parts ) {
    // Here is where you need to get the $bb_job variable
    $bb_job = null; // Change this to the way you use to obtain $bb_job

    // If $bb_job is not empty, assign $bb_job -> job_title
    if($bb_job && $bb_job->job_title){
        $title_parts['title'] = $bb_job->job_title;
    }
    return $title_parts;
}
add_filter( 'document_title_parts', 'custom_document_title', 1000, 1 );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)