Need advice with frontend forms

Support MB Frontend Submission Need advice with frontend forms

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15263
    netalysnetalys
    Participant

    Hi, need a little advice there : I have some custom fields on a post type.
    I want to give the users the possibility to edit those fields with a page on the frontend.
    - First question : what do you think is best : send them to the post page and display a form under the content if they are connected - or create another page on WordPress dedicated to posts edition where I pass the post_id with a querystring for example.
    - 2nd question : I've seen that if I display only the custom fields and save them, the title would be empty, so I have to add post_fields="title" in the shortcode. But I don't want them to edit the title !
    What's your best solution ? Maybe a filter that add a readonly the the title field, or CSS to hide title field ?

    Thanks for your advices !
    Cedric.

    #15266
    Anh TranAnh Tran
    Keymaster

    Hi Cedric,

    1st question: It depends. Both ways work. The 1st one seems to show users the content, while the 2nd one seems to be more cleaner.

    2nd question: To show the title, but don't want to let users edit them, you can use 2 methods:

    • Use a little PHP to output the post title (and exclude post title field from the form shortcode)
    • Or modify the template for post title field (see this guide) and add a new param 'readonly' => true to let users not able to edit it.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.