Created
May 11, 2022 17:10
-
-
Save carlaizumibamford/598a6e5a0e6966895184d1456822ca71 to your computer and use it in GitHub Desktop.
Creating A Custom Wordpress Widget Plugin Vol 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function update( $new_instance, $old_instance ) { | |
$instance = $old_instance; | |
$instance['title'] = isset( $new_instance['title'] ) ? wp_strip_all_tags( $new_instance['title'] ) : ''; | |
$instance['text'] = isset( $new_instance['text'] ) ? wp_strip_all_tags( $new_instance['text'] ) : ''; | |
$instance['textarea'] = isset( $new_instance['textarea'] ) ? wp_kses_post( $new_instance['textarea'] ) : ''; | |
$instance['checkbox'] = isset( $new_instance['checkbox'] ) ? 1 : false; | |
$instance['select'] = isset( $new_instance['select'] ) ? wp_strip_all_tags( $new_instance['select'] ) : ''; | |
return $instance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment