Unable to get post ID from url after updating to 2.3.0

[ad_1]

Hi @mbis,

Found one fix that after removing one condition that was added in 2.3.0 version in file ‘permalink-manager-uri-functions-post.php‘ in function ‘url_to_postid‘.

public function url_to_postid( $url ) {

global $pm_query;

// Filter only defined URLs

if ( empty( $url ) || ! is_array( $pm_query ) ) {

return $url;

}

Removing the condition to check is_array made it work. This was added in latest update version 2.3.0. Is there any issue with that condition?

Hi @ktiwari,

Thank you for your input, and please accept my apologies for the inconvenience.

I changed this to make sure the $pm_query variable is defined.
However, this was not needed, because even if $pm_query is null, the impacted function will execute normally.

I restored the old state of the “if” condition and amended the last update:

Best regards,
Maciej

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer