_instance = $instance; return $instance; } /** * Checks if a widgets checkbox is checked. * * Checks first for a value then verifies the value = checked * * @param string $name - name of checkbox. * * @since 7.2.0 * * @return bool */ public function checked( $name ) { return isset( $this->_instance[ $name ] ) && 'checked' === $this->_instance[ $name ]; } /** * Hide an element_key if a controlling_checkbox is checked. * * @param string $controlling_checkbox - Name of controlling_checkbox field which controls whether to hide this element or not. * @param string $element_key - Match the `element_to_reveal` passed to $this->checkbox() for the checkbox which controls this. * @param bool $reverse - hide on check instead of show on check. * * @todo Convert all uses of this method to supply the $element_key * * @since 7.2.0 * @since 7.2.2 Added the `element_key` argument. * * @return void */ public function hide_element( $controlling_checkbox, $element_key = null, $reverse = false ) { $hide = false; if ( ( $reverse && $this->checked( $controlling_checkbox ) ) || ( ! $reverse && ! $this->checked( $controlling_checkbox ) ) ) { $hide = true; } if ( null !== $element_key ) { ?> data-js="get_field_id( $element_key ) ); ?>" data-advanced-sidebar-menu-hide="1" _instance[ $name ] ) ) { $this->_instance[ $name ] = null; } ?> _instance[ $name ] ); ?> />