I am writing a WP plugin. I have created a button for the user to click in thw WP dashboard. I need to run a function when a user clicks the button, shown with a red arrow. The code snippet for the button is:<p><button class="button button-primary">Update Media Titles and ALT Text</button></p>
. I have already created the function in my class like so:
public function kh_update_media_seo() {
//update media files title and alt tags here
}
I can handle the code that goes in the function alone, I only need help making the button in the WP dashboard fire off this specific function when clicked.
Pardon me if this sounds dump or straight forward. It's my first time doing this.
My plugin is a one file plugin if that helps.