How can I require that a user be logged in, in order to submit an input?

This input will be posted to a MySQL database.

This is the input code as it stands in my plugin:

<input type="text" maxlength="4" name="' . $quanid . '" value="" class="input" />

As of right now, anyone can submit this, regardless of login status.

Read more here: Require user login to submit form


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: