beans_modify_widget_content_attributes

Modify core widgets content attributes, so they use the default UIKit styling.

beans_modify_widget_content_attributes( array $attributes )

Return: (array) The modified widget attributes.

Parameters

NameTypeRequiredDefaultDescription
$attributesarraytrue-The current widget attributes.

Source

function beans_modify_widget_content_attributes( $attributes ) {

	$type = beans_get_widget( 'type' );

	$target = array(
		'archives',
		'categories',
		'links',
		'meta',
		'pages',
		'recent-posts',
		'recent-comments',
	);

	$current_class = isset( $attributes['class'] ) ? $attributes['class'] . ' ' : '';

	if ( in_array( beans_get_widget( 'type' ), $target ) ) {
		$attributes['class'] = $current_class . 'uk-list'; // Automatically escaped.
	}

	if ( 'calendar' == $type ) {
		$attributes['class'] = $current_class . 'uk-table uk-table-condensed'; // Automatically escaped.
	}

	return $attributes;

}