0

I am trying to create an autocomplete widget for wordpress to add to an existing custom theme.

My question is if this is even possible or are widgets strictly only for displaying information?

The only way I see to accept input is from the admin page in the function update() and not from the front-end.

public function update( $new_instance, $old_instance ) {
    $instance = array();
    $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? sanitize_text_field( $new_instance['title'] ) : '';

    return $instance;
}

If this is not possible then what would be the best way of doing this without manually changing the theme a lot?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.