# ablocks/trunk/includes/controls/alignment.php

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version trunk. 49 lines.

- Page: https://pluginprobe.com/plugins/ablocks/trunk/code/includes/controls/alignment.php
- Raw: https://pluginprobe.com/plugins/ablocks/trunk/raw/includes/controls/alignment.php
- Modified: 2026-09-08T12:29:06+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/ablocks/trunk/code/includes/controls/alignment.php#L10-L20`.

```php
<?php
namespace ABlocks\Controls;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use ABlocks\Classes\ControlBaseAbstract;

class Alignment extends ControlBaseAbstract {

	public static function get_attribute_default_value( $is_responsive = false, $default = [] ) {
		if ( $is_responsive ) {
			return array_merge( [
				'value' => 'default',
				'valueTablet' => '',
				'valueMobile' => '',
			], $default );
		}
		return array_merge( [ 'value' => 'default' ], $default );
	}

	public static function get_attribute( $attributeName, $isResponsive = false, $default = [] ) {

		return [
			$attributeName => [
				'type' => 'object',
				'default' => self::get_attribute_default_value( $isResponsive, $default ),
			]
		];
	}

	public static function get_css( $attribute_value, $property = '', $device = '' ) {
		if ( ! is_array( $attribute_value ) ) {
			return [];
		}
		$value = array_merge(
			$device ? self::responsive_defaults() : self::get_attribute_default_value( false ),
			$attribute_value
		);

		$css = [];
		if ( '' !== $value[ 'value' . $device ] ) {
			$css[ $property ] = $value[ 'value' . $device ];
		}
		return $css;
	}
}

```
