WC_Shortcode_Products::parse_legacy_attributes( array $attributes )
Parse legacy attributes.
Description Description
Parameters Parameters
- $attributes
-
(Required) Attributes.
Return Return
(array)
Source Source
File: includes/shortcodes/class-wc-shortcode-products.php
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;
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.2.0 | Introduced. |