layotter icon indicating copy to clipboard operation
layotter copied to clipboard

Filter 'layotter/view/column' and 'layotter/view/row' are missing fields

Open MatzeKitt opened this issue 6 years ago • 0 comments

I’m using the following code:

<?php
function rh_layotter_column_options($content, $class, $options, $row_options, $post_options) {
	die( '<pre>' . print_r( $options, true ) );
}

add_filter('layotter/view/column', 'rh_layotter_column_options', 10, 5);

if( function_exists('acf_add_local_field_group') ):
	acf_add_local_field_group(array(
		'key' => 'group_5940f4dbda17c',
		'title' => 'Column Options',
		'fields' => array(
			array(
				'key' => 'field_599c263511508',
				'label' => 'Sichtbarkeit',
				'name' => 'module_visibility',
				'type' => 'button_group',
				'instructions' => '',
				'required' => 1,
				'conditional_logic' => 0,
				'wrapper' => array(
					'width' => '',
					'class' => '',
					'id' => '',
				),
				'choices' => array(
					'always' => 'Immer',
					'mobile' => 'Smartphone',
					'mobile_only' => 'Smartphone und Tablet',
					'tablet' => 'Tablet',
					'tablet_desktop' => 'Tablet und Desktop',
					'not_mobile' => 'Desktop',
				),
				'allow_null' => 0,
				'default_value' => 'always',
				'layout' => 'horizontal',
				'return_format' => 'value',
			),
		),
		'location' => array(
			array(
				array(
					'param' => 'layotter',
					'operator' => '==',
					'value' => 'col_options',
				),
			),
		),
		'menu_order' => 0,
		'position' => 'normal',
		'style' => 'default',
		'label_placement' => 'top',
		'instruction_placement' => 'label',
		'hide_on_screen' => '',
		'active' => 1,
		'description' => '',
	));
endif;

In the current final version, $options is an array with a containing index module_visibility that has one of the available choices from the ACF field as value.

In the modular version, $options is an empty array.

The same applies to the filter layotter/view/row.

MatzeKitt avatar May 03 '19 06:05 MatzeKitt