Merged in feature/MAW-855-import-code-into-aws (pull request #2)

code import from pantheon

* code import from pantheon
This commit is contained in:
Tony Volpe
2023-12-04 23:08:14 +00:00
parent 8c9b1312bc
commit 8f4b5efda6
4766 changed files with 185592 additions and 239967 deletions

View File

@@ -283,6 +283,7 @@ class WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface {
$date_created = '';
$date_modified = '';
$user_id = '';
$api_version = '';
if ( ! empty( $args['include'] ) ) {
$args['include'] = implode( ',', wp_parse_id_list( $args['include'] ) );
@@ -312,6 +313,11 @@ class WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface {
$date_modified = "AND `date_modified_gmt` BETWEEN STR_TO_DATE('" . esc_sql( $args['modified_after'] ) . "', '%Y-%m-%d %H:%i:%s') and STR_TO_DATE('" . esc_sql( $args['modified_before'] ) . "', '%Y-%m-%d %H:%i:%s')";
}
$api_version_value = $args['api_version'] ?? null;
if ( is_numeric( $api_version_value ) ) {
$api_version = 'AND `api_version`=' . esc_sql( $api_version_value );
}
// Check for cache.
$cache_key = WC_Cache_Helper::get_cache_prefix( 'webhooks' ) . 'search_webhooks' . md5( implode( ',', $args ) );
$cache_value = wp_cache_get( $cache_key, 'webhook_search_results' );
@@ -331,6 +337,7 @@ class WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface {
{$exclude}
{$date_created}
{$date_modified}
{$api_version}
{$user_id}
{$order}
{$limit}