Bug in ewdufaqInit::alter_faq_content()
-
Hello,
The plugin assumes that there will be
global $post
set inewdufaqInit::alter_faq_content()
, but that’s not necessarily true, asthe_content
hook might be called on non-globalWP_Post
object. This may trigger PHP Notice in some circumstances. Please alter the code to from:public function alter_faq_content( $content ) { global $post, $ewd_ufaq_controller; if ( $post->post_type != EWD_UFAQ_FAQ_POST_TYPE ) { return $content; }
to
public function alter_faq_content( $content ) { global $post, $ewd_ufaq_controller; if ( !isset($post) || $post->post_type != EWD_UFAQ_FAQ_POST_TYPE ) { return $content; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Bug in ewdufaqInit::alter_faq_content()’ is closed to new replies.