WordPress.org

Ready to get started?Download WordPress

Forums

Formatting post_content form submission (1 post)

  1. jslom
    Member
    Posted 1 year ago #

    I have a form with multiple fields that will submit to a custom post type, and would like to add some html inside. I am not sure how to approach it. Using my code below, it will submit the field with the name "description" to post_content. What I would like to do is have it displayed like this when Submitted.

    Description : (Description Here)

    although with the current code, it only shows the "Description" input.

    How Can I add "Description:" before the processed field into this array?

    $new_post = array(
    	'post_title'    => $title,
    	'post_content'  => $description,
    	'post_parent' => 599,
    	'post_status'   => 'publish',
    	'post_type' => 'topic'
    );
    <p class="question"><label>Description<input name="description" class="text" id="text" required tabindex="1" type="text">

    Also, if I wanted to add a break after "description" and say another form input like First Name, how could I add it to the 'post_content' => $description, ?

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.