Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List Table not created #11

Open
iniznet opened this issue Jan 3, 2022 · 3 comments · May be fixed by #14
Open

List Table not created #11

iniznet opened this issue Jan 3, 2022 · 3 comments · May be fixed by #14

Comments

@iniznet
Copy link

iniznet commented Jan 3, 2022

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

@cyberwani
Copy link

I am facing the same issue.

@cyberwani
Copy link

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
		),
	)
)

@mircobabini
Copy link

mircobabini commented Mar 3, 2023

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.

@mircobabini mircobabini linked a pull request Mar 3, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants