Automattic\WooCommerce\Admin\API\Reports\Stock
Controller::add_wp_query_group_by()
Group by post ID to prevent duplicates.
Method of the class: Controller{}
No Hooks.
Return
String
.
Usage
$result = Controller::add_wp_query_group_by( $groupby, $wp_query );
- $groupby(string) (required)
- Group by clause used to organize posts.
- $wp_query(object) (required)
- WP_Query object.
Controller::add_wp_query_group_by() Controller::add wp query group by code WC 9.3.3
public static function add_wp_query_group_by( $groupby, $wp_query ) { global $wpdb; if ( empty( $groupby ) ) { $groupby = $wpdb->posts . '.ID'; } return $groupby; }