Press-This stopped redirecting to permalink after post publish

Okay, so after narrowing the problem down to the function get_post_permalink() which gets called by wp-admin/includes/class-wp-press-this.php on Line 181, and for some reason returns the Querystring rather than the Permalink when I am using my 3rd party theme, I implemented a workaround which is not ideal, but it works!

I added the following code, starting after Line 181:

if ( 'publish' === get_post_status( $post_id ) ) {
    $redirect = get_post_permalink( $post_id ); // at this point the function returned a querystring
/**/
/*START - Attempted fix for not redirecting to Permalinks with 3rd Party Theme*/
/**/
$post = get_post($post_id);
$slug = $post->post_name;
$post_link = $redirect;
$post_link = str_replace("%$post->post_type%", $slug, $post_link);
$post_link = home_url( user_trailingslashit($post_link) );
$redirect = $post_link;
/**/
/*END - Attempted fix for not redirecting to Permalinks with 3rd Party Theme*/
/**/
} elseif {...}

So I basically extracted part of the code from get_post_permalink(), and manually added it here to “force” the creation of a permalink from the returned Querystring, after the initial call of $redirect = get_post_permalink( $post_id );.

Again, this is far from ideal! It does work, but it’s a fix for the symptom and not the root cause.

For now this will do, and I’ll just wait for the theme developer to provide a more permanent solution via a theme update!

Once that happens I will update this post with what the theme developer will have to say as to the root cause of this problem to begin with.

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