/
home
/
cabinetdhs
/
www
/
wp-content
/
plugins
/
anywhere-elementor-pro
/
includes
/
modules
/
dynamic-rules
/
rules
/
Upload File
HOME
<?php namespace Aepro\Modules\DynamicRules\Rules; use Aepro\Base\RuleBase; use Elementor\Controls_Manager; if ( ! defined( 'ABSPATH' ) ) { exit; } class Acf_Choice extends RuleBase { public function get_group() { return 'acf'; } public function get_name() { return 'acf_choice'; } public function get_title() { return __( 'ACF Choice', 'ae-pro' ); } public function get_name_control() { return [ 'label' => 'ACF Name', 'type' => Controls_Manager::TEXT, 'default' => '', 'placeholder' => __( 'Name', 'ae-pro' ), ]; } public function get_value_control() { return [ 'label' => 'Value', 'type' => Controls_Manager::TEXT, 'default' => '', 'placeholder' => __( 'Value', 'ae-pro' ), ]; } protected function get_rule_operators() { $rule_operators = []; $rule_operators = [ 'equal' => __( 'Is Equal', 'ae-pro' ), 'not_equal' => __( 'Is Not Equal', 'ae-pro' ), 'contains' => __( 'Contains', 'ae-pro' ), 'not_contains' => __( 'Does Not Contains', 'ae-pro' ), 'empty' => __( 'Is Empty', 'ae-pro' ), 'not_empty' => __( 'Is Not Empty', 'ae-pro' ), ]; return $rule_operators; } public function check( $operator, $value, $name = null) { global $post; $field_value = get_field( $name ); return $this->compare( $field_value, (array) $value, $operator ); } }