-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
📃 Code ReviewAll Discussion Related To WPonion's Code Review.All Discussion Related To WPonion's Code Review.
Description
Review
We need to add is_array or wponion_is_array check.
This is to avoid:
Warning: foreach() argument must be of type array|object, bool given in /plugins/wponion/includes/builder/helper/container/class-functions.php
Which happens when generating an admin page with no coded options code yet.
Screenshot
Fix
/**
* Returns First Container Instance.
*
* @return false|\WPO\Container
*/
public function first_container() {
/* @var \WPO\Container $container */
if ( wponion_is_array( $this->containers() ) ) {
foreach ( $this->containers() as $key => $container ) {
if ( wpo_is_container( $container ) && false === $container->is_disabled() ) {
return $container;
}
}
return false;
}
return false;
}Result
Metadata
Metadata
Assignees
Labels
📃 Code ReviewAll Discussion Related To WPonion's Code Review.All Discussion Related To WPonion's Code Review.