Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the acf domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home2/roadninm/public_html/demos/dom/wp-includes/functions.php on line 6131
foreach() argument must be of type array|object, bool given (500 Internal Server Error)

Symfony Exception

ErrorException

HTTP 500 Internal Server Error

foreach() argument must be of type array|object, bool given

Exception

ErrorException

Show exception properties
ErrorException {#6706
  #severity: E_WARNING
}
  1.     {
  2.         $date r9_get_date();
  3.         $terms get_the_terms(get_the_ID(), 'news-categories');
  4.         $categories = [];
  5.         $term_ids = [];
  6.         foreach ($terms as $term) {
  7.             $term_ids[] = $term->term_id;
  8.             $categories[] = [
  9.                 'id' => $term->term_id,
  10.                 'slug' => $term->slug,
  11.                 'name' => $term->name,
  1.      * @throws \ErrorException
  2.      */
  3.     public function handleError($level$message$file ''$line 0$context = [])
  4.     {
  5.         try {
  6.             parent::handleError($level$message$file$line$context);
  7.         } catch (Throwable $e) {
  8.             if (! apply_filters('acorn/throw_error_exception'true$e)) {
  9.                 return false;
  10.             }
HandleExceptions->handleError(2, 'foreach() argument must be of type array|object, bool given', '/home2/roadninm/public_html/demos/dom/wp-content/themes/r9/app/View/Composers/SingleNews.php', 31) in /home2/roadninm/public_html/demos/dom/wp-content/themes/r9/app/View/Composers/SingleNews.php (line 31)
  1.     {
  2.         $date r9_get_date();
  3.         $terms get_the_terms(get_the_ID(), 'news-categories');
  4.         $categories = [];
  5.         $term_ids = [];
  6.         foreach ($terms as $term) {
  7.             $term_ids[] = $term->term_id;
  8.             $categories[] = [
  9.                 'id' => $term->term_id,
  10.                 'slug' => $term->slug,
  11.                 'name' => $term->name,
  1.      * @return array
  2.      */
  3.     protected function merge()
  4.     {
  5.         return array_merge(
  6.             $this->with(),
  7.             $this->view->getData(),
  8.             $this->override()
  9.         );
  10.     }
  1.     public function compose(View $view)
  2.     {
  3.         $this->view $view;
  4.         $this->data = new Fluent($view->getData());
  5.         $view->with($this->merge());
  6.     }
  7.     /**
  8.      * Data to be merged and passed to the view before rendering.
  9.      *
  1.         // Once we have the class and method name, we can build the Closure to resolve
  2.         // the instance out of the IoC container and call the method on it with the
  3.         // given arguments that are passed to the Closure as the composer's data.
  4.         return function () use ($class$method) {
  5.             return $this->container->make($class)->{$method}(...func_get_args());
  6.         };
  7.     }
  8.     /**
  9.      * Parse a class based composer name.
  1.         return function ($event$payload) use ($listener$wildcard) {
  2.             if ($wildcard) {
  3.                 return $listener($event$payload);
  4.             }
  5.             return $listener(...array_values($payload));
  6.         };
  7.     }
  8.     /**
  9.      * Create a class based listener using the IoC container.
  1.         }
  2.         $responses = [];
  3.         foreach ($this->getListeners($event) as $listener) {
  4.             $response $listener($event$payload);
  5.             // If a response is returned from the listener and event halting is enabled
  6.             // we will just return this response, and not call the rest of the event
  7.             // listeners. Otherwise we will add the response on the response list.
  8.             if ($halt && ! is_null($response)) {
  1.      * @param  \Illuminate\Contracts\View\View  $view
  2.      * @return void
  3.      */
  4.     public function callComposer(ViewContract $view)
  5.     {
  6.         $this->events->dispatch('composing: '.$view->name(), [$view]);
  7.     }
  8.     /**
  9.      * Call the creator for a given view.
  10.      *
  1.         // We will keep track of the number of views being rendered so we can flush
  2.         // the section after the complete rendering operation is done. This will
  3.         // clear out the sections for any separate views that may be rendered.
  4.         $this->factory->incrementRender();
  5.         $this->factory->callComposer($this);
  6.         $contents $this->getContents();
  7.         // Once we've finished rendering the view, we'll decrement the render count
  8.         // so that each section gets flushed out next time a view is created and
  1.      * @throws \Throwable
  2.      */
  3.     public function render(callable $callback null)
  4.     {
  5.         try {
  6.             $contents $this->renderContents();
  7.             $response = isset($callback) ? $callback($this$contents) : null;
  8.             // Once we have the contents of the view, we will flush the sections if we are
  9.             // done rendering all views so that there is nothing left hanging over when
  1. </head>
  2. <body <?php body_class(); ?>>
  3.   <?php wp_body_open(); ?>
  4.   <?php do_action('get_header'); ?>
  5.   <?php echo view(app('sage.view'), app('sage.data'))->render(); ?>
  6.   <?php do_action('get_footer'); ?>
  7.   <?php wp_footer(); ?>
  8. </body>
  9. </html>
include('/home2/roadninm/public_html/demos/dom/wp-content/themes/r9/index.php') in /home2/roadninm/public_html/demos/dom/wp-includes/template-loader.php (line 132)
  1.          *
  2.          * @param string $template The path of the template about to be included.
  3.          */
  4.         do_action'wp_before_include_template'$template );
  5.         include $template;
  6.     } elseif ( current_user_can'switch_themes' ) ) {
  7.         $theme wp_get_theme();
  8.         if ( $theme->errors() ) {
  9.             wp_die$theme->errors() );
  10.         }
require_once('/home2/roadninm/public_html/demos/dom/wp-includes/template-loader.php') in /home2/roadninm/public_html/demos/dom/wp-blog-header.php (line 19)
  1.     // Set up the WordPress query.
  2.     wp();
  3.     // Load the theme template.
  4.     require_once ABSPATH WPINC '/template-loader.php';
  5. }
require('/home2/roadninm/public_html/demos/dom/wp-blog-header.php') in /home2/roadninm/public_html/demos/dom/index.php (line 17)
  1.  * @var bool
  2.  */
  3. define'WP_USE_THEMES'true );
  4. /** Loads the WordPress Environment and Template */
  5. require __DIR__ '/wp-blog-header.php';

Stack Trace

ErrorException
ErrorException:
foreach() argument must be of type array|object, bool given

  at /home2/roadninm/public_html/demos/dom/wp-content/themes/r9/app/View/Composers/SingleNews.php:31
  at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'foreach() argument must be of type array|object, bool given', '/home2/roadninm/public_html/demos/dom/wp-content/themes/r9/app/View/Composers/SingleNews.php', 31, array())
     (/home2/roadninm/public_html/demos/dom/wp-content/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php:49)
  at Roots\Acorn\Bootstrap\HandleExceptions->handleError(2, 'foreach() argument must be of type array|object, bool given', '/home2/roadninm/public_html/demos/dom/wp-content/themes/r9/app/View/Composers/SingleNews.php', 31)
     (/home2/roadninm/public_html/demos/dom/wp-content/themes/r9/app/View/Composers/SingleNews.php:31)
  at App\View\Composers\SingleNews->with()
     (/home2/roadninm/public_html/demos/dom/wp-content/vendor/roots/acorn/src/Roots/Acorn/View/Composer.php:70)
  at Roots\Acorn\View\Composer->merge()
     (/home2/roadninm/public_html/demos/dom/wp-content/vendor/roots/acorn/src/Roots/Acorn/View/Composer.php:59)
  at Roots\Acorn\View\Composer->compose(object(View))
     (/home2/roadninm/public_html/demos/dom/wp-content/vendor/illuminate/view/Concerns/ManagesEvents.php:124)
  at Illuminate\View\Factory->Illuminate\View\Concerns\{closure}(object(View))
     (/home2/roadninm/public_html/demos/dom/wp-content/vendor/illuminate/events/Dispatcher.php:421)
  at Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('composing: single', array(object(View)))
     (/home2/roadninm/public_html/demos/dom/wp-content/vendor/illuminate/events/Dispatcher.php:249)
  at Illuminate\Events\Dispatcher->dispatch('composing: single', array(object(View)))
     (/home2/roadninm/public_html/demos/dom/wp-content/vendor/illuminate/view/Concerns/ManagesEvents.php:177)
  at Illuminate\View\Factory->callComposer(object(View))
     (/home2/roadninm/public_html/demos/dom/wp-content/vendor/illuminate/view/View.php:176)
  at Illuminate\View\View->renderContents()
     (/home2/roadninm/public_html/demos/dom/wp-content/vendor/illuminate/view/View.php:147)
  at Illuminate\View\View->render()
     (/home2/roadninm/public_html/demos/dom/wp-content/themes/r9/index.php:33)
  at include('/home2/roadninm/public_html/demos/dom/wp-content/themes/r9/index.php')
     (/home2/roadninm/public_html/demos/dom/wp-includes/template-loader.php:132)
  at require_once('/home2/roadninm/public_html/demos/dom/wp-includes/template-loader.php')
     (/home2/roadninm/public_html/demos/dom/wp-blog-header.php:19)
  at require('/home2/roadninm/public_html/demos/dom/wp-blog-header.php')
     (/home2/roadninm/public_html/demos/dom/index.php:17)