[Plugin: Custom Post Widget] Correction for properly invoking the_content()
-
Hi. I ran into an issue where one of the the_content filters was running on my Content Block. I added the condition get_post_type() == ‘post’ but it didn’t work.
Upon investigation I discovered that the widget method queries the post data but doesn’t set the global $post object leading to improper conditional values in the “the_content” filter.
Here’s an updated version of the method…
[Code moderated as per the Forum Rules. Please use the pastebin]
Not sure if there is a better way than assigning to the global $post or whether this will have unforeseen consequences in with the shortcode includes…any ideas?
Gratefully,
Hari Karam Singhhttps://www.ads-software.com/extend/plugins/custom-post-widget/
- The topic ‘[Plugin: Custom Post Widget] Correction for properly invoking the_content()’ is closed to new replies.