WordPress at Your Fingertips
function is not described

WC_Shortcode_Products::parse_legacy_attributes() protected WC 3.2.0

Parse legacy attributes.

{} It's a method of the class: WC_Shortcode_Products{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->parse_legacy_attributes( $attributes );
$attributes(array) (required)
Attributes.

Changelog

Since 3.2.0 Introduced.

Code of WC_Shortcode_Products::parse_legacy_attributes() WC 5.9.0

protected function parse_legacy_attributes( $attributes ) {
	$mapping = array(
		'per_page' => 'limit',
		'operator' => 'cat_operator',
		'filter'   => 'terms',
	);

	foreach ( $mapping as $old => $new ) {
		if ( isset( $attributes[ $old ] ) ) {
			$attributes[ $new ] = $attributes[ $old ];
			unset( $attributes[ $old ] );
		}
	}

	return $attributes;
}