Tagged: list-table, piklist_admin_pages
- This topic has 2 replies, 3 voices, and was last updated 7 years, 9 months ago by
Steve.
-
AuthorPosts
-
-
April 2, 2014 at 6:40 am #1635
luminaire801MemberHi guys, i’m trying to create a dashboard Menu Item for users with Subscriber user role. So far, I’ve created the menu using the piklist_admin_pages filter by following the Settings Pages guide. I wanted to have a list-table on that page so I copied the code from field-list-table.php. However the list-table’s css/html seems to be malformed. Am I missing something?
This is the code I used for the Menu Item
//This adds a new Item Menu for the Customer-Portal add_filter('piklist_admin_pages', 'customer_portal_func'); function customer_portal_func($pages) { $pages[] = array( 'page_title' => __('Customer Portal') ,'menu_title' => __('Customer Portal', 'piklist') ,'capability' => 'subscriber' ,'menu_slug' => 'customer_portal' ,'setting' => 'customer_portal' ,'menu_icon' => plugins_url('piklist/parts/img/piklist-icon.png') ,'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png') ); return $pages; }This is the code I used for the Settings Page output
<?php /* Title: Setting: customer_portal Order: 20 */ global $wpdb; $data = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE post_type = %s AND post_status = %s", 'post', 'publish')); foreach ($data as &$row) { $user_data = get_userdata($row->post_author); $row->post_author = $user_data->user_login; } piklist('list_table', array( 'name' => 'Object Example' ,'data' => $data ,'per_page' => 10 ,'key' => 'ID' ,'column' => 'post_title' ,'columns' => array( 'post_title' => 'Post title' ,'post_date' => 'Date' ,'post_author' => 'Author' ,'comment_count' => 'Comments' ) )); -
May 8, 2014 at 5:57 pm #1700
tripflexMemberIt looks right but i can’t find a single thing documentation wise regarding list table besides that example file.
A little help anyone?
-
May 9, 2014 at 3:28 pm #1704
SteveKeymasterList Table is not fully flushed out yet. We’ve included it in demos so you can play with it. Once it’s completed, documentation will go up.
-
-
AuthorPosts
- You must be logged in to reply to this topic.