Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
261 views
in Themes by

I need to remove this line for AMP. What will happen if I removed it ?

$q_view['main_form_tags'] = 'method="post" action="' . qa_self_html() . '"';

1 Answer

+2 votes
by

These are form handlers to collect data for processing to PHP which are then stored to the database.

If you remove them, you won't be able to register an action. Whether if it's posting content (asking/answering/commenting) or vote a post, depending on what this is set for.

Putting it in even simpler terms, once you click the submit button after writing a post, or clicking a vote button, nothing will happen because there's no connection to the database.

Read more about PHP forms.

by
Still it is safe to avoid them for unregistered users who are having read-only access right?
by
I think when the site is set for ready-only access these forms are not rendered, I believe.
If they do, sure, they are of no use for logged-out users, unless it's allowed to ask questions without being registered, which in that case they are still necessary.
by
Yes. I suppose doing amp for such non registered users makes sense as it'll be easier and most Google traffic will be them.
...