1

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.

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?

0

For style and code reference about the default WordPress interface elements, I use the plugin WordPress Admin Style, by Frank Bültge.

It shows CSS ID's and classes, and screenshots, for the following elements:

Columns, Headers, Icons, Buttons, Tables, Admin Notices, Alternative Colours, Pagination, Form elements, Tabs

Full plugin page screenshot at GitHub.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.