I have a database named event-listing-db which contains a table wp_posts. Also i have a function for creating a form with method post with the following structure:

function ru_meta_callback() {
    wp_nonce_field(basename(__FILE__), 'ru_jobs_nonce ');
    ?>
    <form method="POST">
        <div>
            <div class="meta-row">
                <div class="meta-th">
                    <label for="date_listed" class="ru-row-title">Event Date</label>
                </div>
                <div class="meta-td">
                    <input type="text" name="event_date" id="event_date" value=""/>
                </div>
            </div>
            <div class="meta-row">
                <div class="meta-th">
                    <label for="event_location" class="ru-row-title">Event Location</label>
                </div>
                <div class="meta-td">
                    <input type="text" name="event_location" id="event_location" value=""/>
                </div>
            </div>
            <input type="submit" value="Add Event">
        </div>
    </form>
    <?php
}

When i submit the form only the post_title column is filling. My question is: How can i create a columns for event_date and evet_location and fill’em when the data is submitted ?

Read more here: How to add column to wp_post table in database?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: