/**
  * Add a new tab.
  *
  * @param  mixed $file_or_options
  * @param  array $properties
  *
  * @return array
  */
 protected function tab($file_or_options = [], $properties = [])
 {
     if (!is_string($file_or_options) && !is_array($file_or_options)) {
         return;
     }
     $tab = papi_tab($file_or_options, $properties);
     // Tabs sometimes will be in $tab->options['options'] when you use a tab template in this method
     // and using the return value of papi_tab function is used.
     //
     // This should be fixed later, not a priority for now since this works.
     if (is_object($tab) && isset($tab->options) && isset($tab->options['options'])) {
         $tab = (object) $tab->options;
     }
     if (isset($tab->options)) {
         $tab->options = papi_esc_html($tab->options);
     }
     return $tab;
 }
 /**
  * Add a new tab.
  *
  * @param  mixed $file_or_options
  * @param  array $properties
  *
  * @return null|Papi_Core_Tab
  */
 protected function tab($file_or_options = [], $properties = [])
 {
     if (!is_string($file_or_options) && !is_array($file_or_options)) {
         return;
     }
     return papi_tab($file_or_options, $properties);
 }
 /**
  * Add a new tab.
  *
  * @param  mixed $file_or_options
  * @param  array $properties
  *
  * @return null|Papi_Core_Tab
  */
 protected function tab($file_or_options = [], $properties = [])
 {
     if (!is_string($file_or_options) && !is_array($file_or_options)) {
         return;
     }
     $tab = papi_tab($file_or_options, $properties);
     // Since `papi_tab` can be used in a boxes file we need to this check
     // so we can attach properties array if it's missing.
     if (empty($tab->properties) && isset($file_or_options['properties'])) {
         $tab->properties = $file_or_options['properties'];
     }
     return $tab;
 }