How to use default WP form elements to interact with custom DB table?

I know about the use of Custom Post Types, but in this case I do need to use a custom database table (FYI: it’s a table that is IP-based shared with another non-WP website).

In wp-admin, I’d like to use as many as possible default/built-in WP functions for form elements. For example, I’d like to use a photo upload.

Read More

I am also following the CreateReadUpdateDelete (CRUD) principle. So for example, for the read part, I extended the WP_list_table class.

What WP form elements can I use for create and update part?
I started out with this, but it doesn’t look WP-ish

function contender_add_form_display(){
    $return ='
    <div class="wrap">
        <h2>Add contender</h2>
        <form name="contender" method="post" action="'.str_replace( '%7E', '~', $_SERVER['REQUEST_URI']).'">  
         <input type="hidden" name="online" value="1"> 
        <input type="hidden" name="add" value="1">
 <label>Contender Description</label>
        <textarea id="contender_descr" style="width:260px!important;height:250px!important;"  name="contender_descr"></textarea>
etc.
        </form>     
    </div>
    ';
    echo $return;
}

Any tips, pointers?

Related posts

1 comment

Comments are closed.