_list, true );
if ( $new_status_priority !== false && ( is_null( $status ) || $current_status_priority > $new_status_priority ) ) {
return $new_status;
}
return $status;
}
/**
* Updates the regions where a request review is allowed.
*
* @param array $region_status Associative array containing the region eligibility.
* @param array $review_eligible_regions Indexed array with the current eligible regions.
* @param "freeListingsProgram"|"shoppingAdsProgram" $type The program type.
*
* @return array The (maybe) modified $review_eligible_regions array
*/
private function maybe_load_eligible_region( $region_status, $review_eligible_regions, $type = 'freeListingsProgram' ) {
if (
! empty( $region_status['regionCodes'] ) &&
isset( $region_status['reviewEligibilityStatus'] ) &&
$region_status['reviewEligibilityStatus'] === self::ELIGIBLE
) {
$region_codes = $region_status['regionCodes'];
sort( $region_codes ); // sometimes the regions come unsorted between the different programs
$region_id = $region_codes[0];
if ( ! isset( $review_eligible_regions[ $region_id ] ) ) {
$review_eligible_regions[ $region_id ] = [];
}
$review_eligible_regions[ $region_id ][] = strtolower( $type ); // lowercase as is how we expect it in WCS
}
return $review_eligible_regions;
}
/**
* Allows a hook to modify the lifetime of the Account review data.
*
* @return int
*/
public function get_account_review_lifetime(): int {
return apply_filters( 'woocommerce_gla_mc_account_review_lifetime', self::MC_ACCOUNT_REVIEW_LIFETIME );
}
/**
* @param int $cooldown The cooldown in PHP format (seconds)
*
* @return int The cooldown in milliseconds and adding the lifetime cache
*/
private function get_cooldown( int $cooldown ) {
if ( $cooldown ) {
$cooldown = ( $cooldown + $this->get_account_review_lifetime() ) * 1000;
}
return $cooldown;
}
}
Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Google\RequestReviewStatuses does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73
Warning: foreach() argument must be of type array|object, bool given in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73
* Given a provided context, returns whether the context refers to header content.
*
* @param array|\WP_Post|\WP_Block_Template $context Where the block is embedded.
* @param string $area The area to check against before inserting.
* @since 8.5.0
* @return boolean
*/
protected function is_template_part_or_pattern( $context, $area ) {
$is_pattern = is_array( $context ) &&
(
( isset( $context['blockTypes'] ) && in_array( 'core/template-part/' . $area, $context['blockTypes'], true ) ) ||
( isset( $context['categories'] ) && in_array( $area, $context['categories'], true ) )
);
$is_template_part = $context instanceof \WP_Block_Template && $area === $context->area;
return ( $is_pattern || $is_template_part );
}
/**
* Given a provided context, returns whether the context refers to the target area and isn't marked as excluded.
*
* @param array|\WP_Post|\WP_Block_Template $context the context to check.
* @param string $area The area to check against before inserting.
* @since 8.5.0
* @return boolean
*/
protected function is_target_area( $context, $area ) {
if ( $this->is_template_part_or_pattern( $context, $area ) && ! $this->pattern_is_excluded( $context ) ) {
return true;
}
return false;
}
/**
* Returns whether the pattern is excluded or not
*
* @since 8.5.0
*
* @param array|\WP_Block_Template $context Where the block is embedded.
* @return boolean
*/
protected function pattern_is_excluded( $context ) {
/**
* A list of pattern slugs to exclude from auto-insert (useful when there are patterns that have a very specific location for the block)
* Note: The patterns that are currently excluded are the ones that don't work well with the mini-cart block or customer-account block.
*
* @since 8.5.0
*/
$pattern_exclude_list = apply_filters(
'woocommerce_hooked_blocks_pattern_exclude_list',
array_unique( array_merge( isset( $this->hooked_block_excluded_patterns ) ? $this->hooked_block_excluded_patterns : array(), array( 'twentytwentytwo/header-centered-logo', 'twentytwentytwo/header-stacked' ) ) )
);
$pattern_slug = is_array( $context ) && isset( $context['slug'] ) ? $context['slug'] : '';
if ( ! $pattern_slug ) {
/**
* Woo patterns have a slug property in $context, but core/theme patterns dont.
* In that case, we fallback to the name property, as they're the same.
*/
$pattern_slug = is_array( $context ) && isset( $context['name'] ) ? $context['name'] : '';
}
return in_array( $pattern_slug, $pattern_exclude_list, true );
}
}
Fatal error: Trait "Automattic\WooCommerce\Blocks\Utils\BlockHooksTrait" not found in /htdocs/wp-content/plugins/woocommerce/src/Blocks/BlockTypes/CustomerAccount.php on line 11