'Enable Condition', 'hidden' => false, ); public $object_type; /** * Initialize Conditional Logic field. * * @since 2.5 * * @param array $props Field properties. * @param \Gravity_Forms\Gravity_Forms\Settings\Settings $settings Settings instance. */ public function __construct( $props, $settings ) { parent::__construct( $props, $settings ); // Populate default instructions. if ( $this->object_type === 'feed_condition' && ! rgobj( $this, 'instructions' ) ) { $this->instructions = esc_html__( 'Process this feed if', 'gravityforms' ); } // Translate Checkbox label. if ( $this->checkbox['label'] === 'Enable Condition' ) { $this->checkbox['label'] = esc_html__( 'Enable Condition', 'gravityforms' ); } // Initialize Checkbox field. $this->inputs['checkbox'] = Fields::create( array( 'name' => sprintf( '%s_conditional_logic', esc_attr( $this->object_type ) ), 'type' => 'checkbox', 'hidden' => $this->checkbox['hidden'], 'choices' => array( array( 'label' => $this->checkbox['label'], 'name' => sprintf( '%s_conditional_logic', esc_attr( $this->object_type ) ), ), ), 'onclick' => sprintf( 'ToggleConditionalLogic( false, "%s" );', esc_attr( $this->object_type ) ), ), $settings ); // Initialize Hidden field. $this->inputs['hidden'] = Fields::create( array( 'name' => sprintf( '%s_conditional_logic_object', esc_attr( $this->object_type ) ), 'type' => 'hidden', 'default_value' => wp_json_encode( $this->get_logic_object() ), ), $settings ); } // # RENDER METHODS ------------------------------------------------------------------------------------------------ /** * Render field. * * @since 2.5 * * @return string */ public function markup() { // Display description. $html = $this->get_description(); $html .= ''; $html .= $this->inputs['hidden']->markup(); $html .= $this->inputs['checkbox']->markup(); $html .= ''; $html .= sprintf( '