public function get_current_row_size() { $images_left = count($this->images); if ($images_left < 3) { return array_fill(0, $images_left, 1); } foreach (array('One_Three', 'One_Two', 'Five', 'Four', 'Three', 'Two_One', 'Symmetric_Row', 'Panoramic') as $shape_name) { $class_name = "Jetpack_Tiled_Gallery_{$shape_name}"; $shape = new $class_name($this->images); if ($shape->is_possible()) { Jetpack_Tiled_Gallery_Shape::set_last_shape($class_name); return $shape->shape; } } Jetpack_Tiled_Gallery_Shape::set_last_shape('Two'); return array(1, 1); }
public function get_current_row_size() { $images_left = count($this->images); if ($images_left < 3) { return array_fill(0, $images_left, 1); } foreach ($this->shapes as $shape_name) { $class_name = "Jetpack_Tiled_Gallery_{$shape_name}"; $shape = new $class_name($this->images); if ($shape->is_possible()) { Jetpack_Tiled_Gallery_Shape::set_last_shape($class_name); return $shape->shape; } } Jetpack_Tiled_Gallery_Shape::set_last_shape('Two'); return array(1, 1); }