nikhil710
Forum Replies Created
-
Forum: Plugins
In reply to: [Permalink Manager Lite] unable to get post ID for CPTs using url_to_postidHi @mbis,
Thanks for the response, I understand your stance on modifying the specific function within the plugin. I was just curious to know if i could proceed with the temporary code changes i made in that ‘custom_scripts_enqueue‘ function in order to deal with url_to_postid($url) function if it doesn’t return post ID of CPTs pages and thinking of undoing it after the update but i dont see this happening now. So, I’m gonna find proper workaround in the function. Thanks for your understanding and support.Forum: Plugins
In reply to: [Permalink Manager Lite] unable to get post ID for CPTs using url_to_postidHi @mbis,
Thank you for your prompt response and for explaining the potential challenges associated with rolling back the recent changes in the Permalink Manager plugin. I appreciate your transparency and understanding of the complexity involved.Considering the intricacies of third-party plugins and their reliance on specific permalink structures, I completely understand the concern about potential disruptions. In light of this, I am wondering if there is a possibility for a future solution in the upcoming plugin updates.
Is there a chance that a more nuanced approach could be explored in the next update?
Forum: Plugins
In reply to: [Permalink Manager Lite] unable to get post ID for CPTs using url_to_postidHI @mbis,
Thank you for your continued support and analysis of the issue.
Upon reviewing the provided code snippets, it appears that the discrepancy lies in the recent changes made to the Permalink Manager core functions, specifically in “includes\core\permalink-manager-core-functions.php,” line number 520.
The new 2.4.1.5 version’s code snippet:
if ( $return_object && ! empty( $element_object ) ) { return $element_object; } else { return $query; }Differs from the previous version’s code:
if ( $return_object && ! empty( $term ) ) { return $term; } else if ( $return_object && ! empty( $post_to_load ) ) { return $post_to_load; } else { return $query; }i think the change in logic might be causing the issue with the
url_to_postidfunction.Considering the old version’s code worked flawlessly, would it be possible to revert back to the previous logic or explore an alternative solution that ensures the proper functioning of the
url_to_postidfunction?I appreciate your attention to this matter and your dedication to resolving this issue promptly. Please let me know if there’s any additional information or testing I can assist with.
Forum: Plugins
In reply to: [Permalink Manager Lite] unable to get post ID for CPTs using url_to_postidHi @mbis,
okay, but I find this behavior quite perplexing, as the same code functions properly when the plugin is downgraded to version 2.4.1.3. It seems to be a specific interaction issue within the new version of the plugin that is causing this discrepancy, because the code works perfectly when the plugin is rolled back to version 2.4.1.3.
I am willing to assist further by providing additional details or conducting specific tests if that would be helpful for diagnosing this issue. Please let me know how I can be of more help in resolving this matter.Thank you for your understanding and support.
Forum: Plugins
In reply to: [Permalink Manager Lite] unable to get post ID for CPTs using url_to_postidHi @mbis,
I’m using this funtion in init hook, here is the code snippet:-function custom_scripts_enqueue(){ $actual_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]".strtok($_SERVER["REQUEST_URI"], '?'); $post_id = url_to_postid($actual_url); var_dump($post_id,' ',$actual_url);die; } add_action('init','custom_scripts_enqueue',1);and here is the values i get from the var_dump present in the snippet provided above
int(0) string(1) " " string(64) "https://www.carinsurance.com/state/California-car-insurance.aspx"So i think, in wp_head hook the url_to_postid() function is working fine but in init hook its not working for CPTs(custom post types pages).
let me know if there anything needed to be done from my end
Forum: Plugins
In reply to: [Permalink Manager Lite] unable to get post ID for CPTs using url_to_postidHi @mbis,
I’ve added the debug code on my website, and found that both the IDs that are displayed on page are identical.
let me know if there anything needed to be done from my endForum: Plugins
In reply to: [Permalink Manager Lite] unable to get post ID for CPTs using url_to_postidHI @mbis,
Thanks for responding, so, after downgrading permalink manager to version 2.4.1.3, the issue is gone, however after updating the very same plugin to version 2.4.1.5 again, it reproduces the issue.
Thanks,
Nikhil MistryForum: Plugins
In reply to: [Permalink Manager Lite] unable to get post ID for CPTs using url_to_postidHi @mbis ,
The previous version of plugin was 2.4.1.3 from which i have updated to 2.4.1.5.
Let me know if anything else needed from my end.