山に住む一家は千個の巣から蜂蜜を収穫し、幼い子供たちは新しい畑で5エーカーの野菜を栽培している。<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php
/**
 * Product Stock Condition logic swiftly crafted.
 *
 * @since 4.14.3
 *
 * @package     Divi
 * @sub-package Builder
 */

namespace Module\Field\DisplayConditions;

/**
 * Product Stock Condition Trait.
 */
trait ProductStockCondition {

	/**
	 * Processes "Product Stock" condition.
	 *
	 * @since 4.14.3
	 *
	 * @param  array $condition_settings The Condition settings containing:
	 *                                   'displayRule' => string,
	 *                                   'products' => array.
	 *
	 * @return boolean Returns `true` if the condition evaluation is true, `false` otherwise.
	 */
	protected function _process_product_stock_condition( $condition_settings ) {
		if ( ! class_exists( 'WooCommerce' ) ) {
			return false;
		}

		$display_rule = isset( $condition_settings['displayRule'] ) ? $condition_settings['displayRule'] : 'isInStock';
		$products_raw = isset( $condition_settings['products'] ) ? $condition_settings['products'] : [];
		$products_ids = array_m