# meow-gallery/4.2.0/classes/builders/square.php

Meow Gallery, version 4.2.0. 31 lines.

- Page: https://pluginprobe.com/plugins/meow-gallery/4.2.0/code/classes/builders/square.php
- Raw: https://pluginprobe.com/plugins/meow-gallery/4.2.0/raw/classes/builders/square.php
- Modified: 2020-08-21T02:47:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/meow-gallery/4.2.0/code/classes/builders/square.php#L10-L20`.

```php
<?php

class Meow_MGL_Builders_Square extends Meow_MGL_Builders_Core {

	public function __construct( $atts, $infinite, $isPreview = false ) {
		parent::__construct( $atts, $infinite, $isPreview );
		$this->layout = 'square';
	}

	function inline_css() {
		$class_id = '#' . $this->class_id;
		$gutter = isset( $this->atts['gutter'] ) ? $this->atts['gutter'] : get_option( 'mgl_square_gutter', 10 );
		$columns = isset( $this->atts['columns'] ) ? $this->atts['columns'] : get_option( 'mgl_square_columns', 5 );
		$isPreview = $this->isPreview;
		ob_start();
		include dirname( __FILE__ ) . '/square.css.php';
		$html = ob_get_clean();
		return $html;
	}

	function build_next_cell( $id, $data ) {
		$html = parent::build_next_cell( $id, $data );
		$columns = ( isset( $this->atts['columns'] ) ? $this->atts['columns'] : get_option( 'mgl_square_columns', 5 ) ) + 1;
		$html = str_replace( '100vw', 100 / $columns . 'vw', $html );
		return $html;
	}

}

?>

```
