Support

Account

Home Forums Front-end Issues Front end form titles question

Helping

Front end form titles question

    • jimmy

    • July 18, 2013 at 6:36 am

    hi guys,

    I’m creating a form on the front end. I have a few questions.

    I’m following this code from the tutorial.

    // Create a new post
    $post = array(
    ‘post_status’ => ‘draft’ ,
    ‘post_title’ => ‘A title, maybe a $_POST variable’ ,
    ‘post_type’ => ‘post’ ,
    );

    I need to add an input field so the user can put the title. How can I achieve that? Where do I put the input field?

    <div id=”content” role=”main”>
    <?php

    $args = array(
    ‘post_id’ => ‘new’,
    ‘field_groups’ => array( 123 )
    );

    acf_form( $args );

    ?>
    </div><!– #content –>

    #####2nd question :

    How can I change the button? it says “update”. I like to change to “create new post”

    ####3rd question : is it possible make the form go to a pending section and that only the admin approves it after?

    thanks in advance!

    • Elliot

    • July 18, 2013 at 3:14 pm

    Hi @jimmy

    1. How to add an extra field
    You can do this by passing in extra HTML to the $args array like so:

    
    'html_before_fields' => '<input type="text" name="post_title" />'
    

    2. Change the button text
    Again, you can pass this in through the args:

    
    'submit_value' => 'Make new thing!'
    

    3. Pending
    This is out of the scope of ACF, however, your above code will create a draft post which is kind of the same thing as pending. You would then need an Admin to edit and save the draft to publish it onto the site

    Does that help?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.