CT
CT copied to clipboard
List Table not created
The list table page is not created after I put example code, though it's able to create the database and entries with db->insert
Am I missing something?
WordPress 5.8.2 PHP 8.0
I am facing the same issue.
Add menu_title and parent_slug in the [views][list] as below, and it will work.
'list' => array(
'menu_title' => __( 'Logs', 'gamipress' ),
'parent_slug' => 'tools.php',
// 'per_page' => 40 // This will force the per page initial value
// The columns arg is a shortcut of the manage_columns and manage_sortable_columns commonly required hooks
'columns' => array(
'title' => array(
'label' => __( 'Title' ),
'sortable' => 'title', // ORDER BY title ASC
),
'status' => array(
'label' => __( 'Status' ),
'sortable' => array( 'status', false ), // ORDER BY status ASC
),
'date' => array(
'label' => __( 'Date' ),
'sortable' => array( 'date', true ), // ORDER BY date DESC
),
)
)
Please note that the solution is to add 'parent_slug' => '', which means "add to the root".
Using a different parent_slug is gonna lead into issues like #12.