• Resolved themefour

    (@themefour)


    Hi. I don’t know how I can show the defined fields to the user to fill in and display them on another page.

    I created a page that I want to fill in the fields for the users to fill. How do I do this? Can you show me an example?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter themefour

    (@themefour)

    In the first shot, I have written Metabax for the management environment (wp admin, Products). In the second shot (2), I want the user to be able to fill in the field that the admin can fill in the product edit page (dokan plugin).

    sshot1:
    https://ibb.co/mXRJKF7

    sshot2:
    https://ibb.co/ZhMkrgQ

    sshot3:
    https://ibb.co/gWYKbFj

    • This reply was modified 4 years, 2 months ago by themefour.
    Thread Starter themefour

    (@themefour)

    How can I also display the box fields in Front End? For the user to fill in?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi @themefour

    Trying to summarize what you’re hoping to accomplish.

    You want to provide a form on the front-end for a logged in user to fill in and save the submitted items for. The content submitted should be saved as user meta for that user?

    Then you want to output that content somewhere else on the site, say a profile?

    Thread Starter themefour

    (@themefour)

    @tw2113 I want the same field that appears on the product edit page to be displayed on another page (in FrontEnd) and the user fills it in!

    https://ibb.co/8gbpsP5

    my code for show metaboxs in product posttype:

    add_action( ‘cmb2_admin_init’, ‘studiare_metaboxes’ );

    function studiare_metaboxes() {
    // Start with an underscore to hide fields from custom fields list
    $prefix = ‘_studiare_’;

    $studiare_metaboxes = new_cmb2_box( array(
    ‘id’ => ‘page_metabox’,
    ‘title’ => esc_html__( ‘Page Settings’, ‘tdomain’ ),
    ‘object_types’ => array( ‘page’, ‘post’ ),
    ‘context’ => ‘normal’,
    ‘priority’ => ‘high’,
    ‘show_names’ => true,
    ) );

    $courses_metaboxes->add_field( array(
    ‘name’ => esc_html__( ‘نوع یا فرمت فایل’, ‘tdomain” ),
    ‘desc’ => esc_html__( ‘نوع یا فرمت فایل های محصول را وارد کنید. مثلا PSD’, ‘tdomain” ),
    ‘default’ => ”,
    ‘id’ => $prefix . ‘download_format’,
    ‘type’ => ‘text’,
    ) );

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    At least in terms of providing a frontend form to use, I would review the following urls:

    https://github.com/CMB2/CMB2/wiki/Bringing-Metaboxes-to-the-Front-End
    https://github.com/CMB2/CMB2-Snippet-Library/tree/master/front-end

    Regarding display of the saved values, you would need to set up a solution that allows you to know the correct page ID that the data is saved to, and use that in conjunction with things like get_post_meta() and the like.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘User fill in field value’ is closed to new replies.