• Resolved matt_fw

    (@matt_fw)


    Hello,

    The plugin assumes that there will be global $post set in ewdufaqInit::alter_faq_content(), but that’s not necessarily true, as the_content hook might be called on non-global WP_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; }
    
    • This topic was modified 3 years, 4 months ago by matt_fw.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support jaysupport

    (@jaysupport)

    Hi Matt,

    Thanks for the suggestion. While this will be seldomly encountered, it could indeed display a PHP notice if you have debug enabled and the case you mentioned.

    We’ll modify the condition and include that as part of the next release.

    Plugin Support jaysupport

    (@jaysupport)

    The new release includes an update to the condition.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bug in ewdufaqInit::alter_faq_content()’ is closed to new replies.