Custom Fields
Re-Envisioned
Support MB Frontend Submission Save, Edit & Delete Methods WITHOUT Dashboard

  • Creator
    Topic
  • #31154
    jmcbade
    Participant

    Since I can not use MB "Dashboard" for this project because I need to use "Roles/Capabilities on an archive to process the posts...

    I am NOT asking how to or expect MB to manage Roles.

    What I am thinking is I might just need to use a regular WP archive and then have buttons that lead to forms that do these tasks. The buttons would need to lead to these forms and populate the form with the data from the current post.

    How can I create forms with these three features (may need different forms right) for front end management of these posts?

    Please provide an alternative to MB "Dashboard".

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #31187
    jmcbade
    Participant

    If I have an archive listing and in that listing I want to pass the ID to the form on a page page and populate it for editing, what would that shortcode look like?

    May I have an example please?

    #31188
    Long Nguyen
    Moderator

    Hi,

    I think Anh Tran has told you to use the query string to edit a post if the user capability/role can edit it, such as editor.

    You can edit the archive page then add a button with a query string in the loop

    http://siteurl.com/frontend-submit-page-slug/?rwmb_frontend_field_post_id=123
    

    there is no prebuilt shortcode that supports this case. You need to create a custom code to do that.

    Get more details on the documentation https://docs.metabox.io/extensions/mb-frontend-submission/#dynamic-population

    #31231
    jmcbade
    Participant

    I can't hard code the post ID.

    There is a parameter called "current" Should that work somehow?

    #31243
    Long Nguyen
    Moderator

    Hi,

    You can get the post ID dynamically in the loop by using the WordPress function get_the_ID(). Screen record for demo https://share.getcloudapp.com/DOu6nlRq

    Code:
    <?php echo '<a href="http://siteurl.com/frontend-submit-page-slug/?rwmb_frontend_field_post_id=' . get_the_ID() . '">Edit post 12345</a>'; ?>

    Theme: Twenty TwentyOne, file archive.php
    https://github.com/WordPress/twentytwentyone/blob/trunk/archive.php#L26-L29

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.