Open VR51 opened 7 years ago
Hi,
It's not supported at the moment, sorry. However, it sounds like a good idea.
Thank you, Michael. Would love to see it added.
I've dome some experimentation with front-end forms, using the APF form class. It came out to be functional. One thing to keep in mind is that you have to style the form by yourself.
If you like, you should try this demonstration plugin. Please make sure you have Admin Page Framework v3.8.11 or above.
The demo plugin consists of four files.
For the usage, please see the doc-block section of the AdminPageFramework_FrontendFormBeta_Base
class. Basically, you set up a custom hook and define fields and a stylesheet in an extended class. And then just instantiate the extended class. The demo plugin uses the the_content
filter hook as an example. You can set your custom filter/action in your desired location. It should be strait forward. Modify the AdminPageFramework_FrontendFormBeta
class and play around with it. It might be easier than writing one from scratch.
Hope you like it. Let me know if you encounter problems.
Wow! Thank you very much. Will download and play with this in a few minutes.
@wowthemes It's not part of the core. You have to implement it by yourself. It's just a matter of copy & paste and renaming classes though.
The submission data is not stored anywhere by itself. You want to do it by yourself in the validate()
method. Just do something like update_option( $first_parameter, 'your_option_key' )
where $first_parameter
is the first parameter variable of the validate()
method.
Can this be used to add frontend forms that are safe for anonymous user input?
I'm in the middle of converting my own plugins to use Admin Page Framework. Would keep the code lighter if I can use the fields on the frontend too.