_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 reveal_element if a checkbox is checked. * * @param string $checkbox - name of checkbox reveal_element which controls this one. * @param string $reveal_element - match the reveal element passed to checkbox which reveals this. * @param bool $reverse - hide on check instead of show on check. * * @todo Convert all uses of this method to supply the $reveal_element * * @since 7.2.0 * @since 7.2.2 Added the `reveal_element` argument. * * @return void */ public function hide_element( $checkbox, $reveal_element = null, $reverse = false ) { $hide = false; if ( ( $reverse && $this->checked( $checkbox ) ) || ( ! $reverse && ! $this->checked( $checkbox ) ) ) { $hide = true; } if ( null !== $reveal_element ) { ?> data-js="get_field_id( $reveal_element ) ); ?>" data-advanced-sidebar-menu-hide="1" _instance[ $name ] ) ) { $this->_instance[ $name ] = null; } ?> _instance[ $name ] ); ?> />