i have two versions of a plugin

Question

I made two versions of a bibliographic plugin. In one use class wp_list_table + CRUD with a specific table (web_datos). In another use post_type + custom fields. Both work, although improvements are still needed. But I have read that they can be combined, that the data of the custom fields can be stored in columns of a specific table. I have found the function of correspondence between the metaboxes and the columns, but I think I need a function similar to get_post_meta / update_post_meta, but that works with a specific table, I just can’t find documentation about it. Any ideas?

add_filter( 'meta_boxes', 'web_register_meta_boxes' );
function webregister_meta_boxes( $meta_boxes ) {
    $meta_boxes[] = array(
        'title'        => 'web',
        'storage_type' => 'custom_table',    // Important
        'table'        => 'web_datos', // Your custom table name
        'fields'       => array(
            array(
                'id'   => 'web_date',
                'type' => 'datetime',
                'name' => 'Date',
            ),
            array(
                'id'   => 'web_pubdate',
                'type' => 'datetime',
                'name' => 'Publicacion',
            ),
            array(
                'id'   => 'web_titulo',
                'type' => 'text',
                'name' => 'Título',
            ),
            array(
                'id'   => 'web_autor',
                'type' => 'text',
                'name' => 'Autor',
            ),
            array(
                'id'   => 'web_coautor',
                'type' => 'text',
                'name' => 'Coautor',
            ),
            array(
                'id'   => 'web_direccion',
                'type' => 'text',
                'name' => 'Direccion',
            ),
            array(
                'id'   => 'web_programa',
                'type' => 'text',
                'name' => 'Programa',
            ),
            array(
                'id'   => 'web_paiscity',
                'type' => 'text',
                'name' => 'País',
            ),
            array(
                'id'   => 'web_idioma',
                'type' => 'text',
                'name' => 'Idioma',
            ),
            array(
                'id'   => 'web_clasif',
                'type' => 'text',
                'name' => 'Clasificacion',
            ),
            array(
                'id'   => 'web_descarga',
                'type' => 'text',
                'name' => 'Descarga',
            ),
            array(
                'id'   => 'web_institucion',
                'type' => 'text',
                'name' => 'Institucion',
            ),
            array(
                'id'   => 'web_resumen',
                'type' => 'text',
                'name' => 'Resumen',
            ),
            array(
                'id'   => 'web_pags',
                'type' => 'text',
                'name' => 'Páginas',
            ),

            
        ),
    );
    return $meta_boxes;
}
0
Oox 2 years 2020-10-24T19:10:37-05:00 0 Answers 19 views 0

Leave an answer

Browse
Browse