Title: patch for three undefined variable or null warnings
Last modified: August 14, 2018

---

# patch for three undefined variable or null warnings

 *  [MeraX](https://wordpress.org/support/users/merax/)
 * (@merax)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/patch-for-three-undefined-variable-or-null-warnings/)
 * Dear Rafael,
 * I would like to commit a little patch for three undefined variable or null warnings:
 * in superior-faq.php
 *     ```
       @@ -268,7 +268,7 @@ if(!class_exists('Superior_FAQ')) {
   
                               global $post;
   
       -                       if($post->post_type == 'faq') {
       +                       if(isset($post->post_type) && $post->post_type == 'faq') {
                                       //get selected template for faqs posts
                                       $settings = get_option( 'superior_faq_settings' );
   
       @@ -292,8 +292,9 @@ if(!class_exists('Superior_FAQ')) {
   
                               global $post;
   
       -                   if ( is_admin() || $post->post_type != 'faq' ) return;
       +                   if ( is_admin() || (isset($post->post_type) && $post->post_type != 'faq') ) return;
                           if ( empty ( $post_id) ) {
       +                       if (! isset($post->ID) ) return;
                               $post_id = $post->ID;
                           }
   
       @@ -315,7 +316,7 @@ if(!class_exists('Superior_FAQ')) {
                       public function faq_content_filter( $content ) {
   
                               global $post;
       -                       if($post->post_type == 'faq') {
       +                       if(! is_null($post) && $post->post_type == 'faq') {
   
                                       $settings = get_option( 'superior_faq_settings' );
       ```
   

The topic ‘patch for three undefined variable or null warnings’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/superior-faq_f0dace.svg)
 * [Superior FAQ](https://wordpress.org/plugins/superior-faq/)
 * [Support Threads](https://wordpress.org/support/plugin/superior-faq/)
 * [Active Topics](https://wordpress.org/support/plugin/superior-faq/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/superior-faq/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/superior-faq/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [MeraX](https://wordpress.org/support/users/merax/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/patch-for-three-undefined-variable-or-null-warnings/)
 * Status: not a support question