wc_products_array_orderby_title( WC_Product $a, WC_Product $b )

Sort by title.


Description Description


Parameters Parameters

$a

(Required) First WC_Product object.

$b

(Required) Second WC_Product object.


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/wc-product-functions.php

function wc_products_array_orderby_title( $a, $b ) {
	return strcasecmp( $a->get_name(), $b->get_name() );
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.