WC_API_Customers::modify_user_query()publicWC 2.1

Modify the WP_User_Query to support filtering on the date the customer was created

Метод класса: WC_API_Customers{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WC_API_Customers = new WC_API_Customers();
$WC_API_Customers->modify_user_query( $query );
$query(WP_User_Query) (обязательный)
-

Список изменений

С версии 2.1 Введена.

Код WC_API_Customers::modify_user_query() WC 8.7.0

public function modify_user_query( $query ) {

	if ( $this->created_at_min ) {
		$query->query_where .= sprintf( " AND user_registered >= STR_TO_DATE( '%s', '%%Y-%%m-%%d %%H:%%i:%%s' )", esc_sql( $this->created_at_min ) );
	}

	if ( $this->created_at_max ) {
		$query->query_where .= sprintf( " AND user_registered <= STR_TO_DATE( '%s', '%%Y-%%m-%%d %%H:%%i:%%s' )", esc_sql( $this->created_at_max ) );
	}
}