I’m building a small plugin for a Woocommerce installation that includes a custom WP_Lists_Table. I added a couple custom bulk actions. Executing a bulk action does nothing at all. I put error_log
messages in the bulk action handler function for debugging, but nothing. The actions are listed in the drop-down bulk actions menu.
I took the bulk actions code from my plugin, modified for the default WP edit post screen, and it works as expected there, returning the error log messages and the admin notice.
Not sure if it has to do with the screen id, which is woocommerce_page_tkwd-wc-my-plugin
.
Or maybe it’s my implementation of the list table.
The URL on initial page load:
https://localhost/wordpress-4/wp-admin/admin.php?page=tkwd-wc-my-plugin
After bulk actions Apply with two records selected (slashes are encoded):
https://localhost/wordpress-4/wp-admin/admin.php?s&_wpnonce=180992d0f0&_wp_http_referer=%2Fwordpress-4%2Fwp-admin%2Fadmin.php%3Fpage%3Dtkwd-wc-my-plugin&action=hidden&paged=1&user[0]=5&user[1]=4&action2=-1&page=tkwd-wc-my-plugin
The action value and record IDs are passed to the URL, but that’s all.
It’s seems the handler function just isn’t firing.
Bulk actions code:
https://pastebin.com/evJ2cr3Q
WP List Table code:
https://pastebin.com/zx7BrdDr
WP List Table relevant markup:
https://pastebin.com/zczVDapj
Any help or suggestions greatly appreciated!
]]>I’m creating custom menu page and using WP_List_Table class to output the data with row action. Till know i don’t know how to redirect the right way after deleted that, but temporary i use menu_page_url and add deleted query string at the end of url. it works so far. Now that i wanna ask here are:
Thanks before and appreciated for the helps.
]]>https://www.gesamtschule-marienheide.de/?page_id=13
responsible is the “fixed tag” in
<table class=”wp-list-table widefat fixed pages list-container”>
How can I fix this?
]]>I’m busy to write my own plugin for WordPress (It’s for my own). I have now that the data from an mysql table shows on the plugin page. I used an Bootstrap table. Now I want to show the data in an WordPress table. An WP List Table. In the WordPress docs I cannot find an solution to use the WordPress table with data from another MYSQL table. I have used this tutorial: https://www.sitepoint.com/using-wp_list_table-to-create-wordpress-admin-tables/ but the table don’t show. Can anybody help me?
Thank you!
]]>When i try to instantiate the same object (and prepare/display data) outside admin from a plugin shortcode in a front end page, it fails.
When I turn on debug messages , it says
Fatal error: Call to undefined function convert_to_screen() in /home/sites/twsdev.co.uk/public_html/jobs/wp-content/plugins/jobs/class-wp-list-table.php on line 143
what changes should i make outside admin?
]]>I followed various tutorials and examples of wp-list-table class, but the result was not very good. Two specific (major) issues:
I am looking for advice regarding my use of wp-list-table class for my purpose:
Any advice/suggestions are greatly appreciated.
John Zhu
[email protected]
I have a very strange problem with the post lists on wordpress admin. If an user is only first author (like he created the post) or only co-author, then everything works fine and the post list is complete.
But when an user is first author of some posts and co-authors of others, then the problem occurs and the list is incomplete and shows only posts where the user is first author.
Some extra details visiting the page edit.php?author_name=john-smith&post_type=member:
I’ve dumped the query var $where from the function posts_where_filter on co-authors-plus.php, with an admin account and with an author account.
here is the query which works (admin user):
string(442) ” AND ((wp_posts.post_author = 826 OR (wp_term_taxonomy.taxonomy = ‘author’ AND wp_term_taxonomy.term_id = ‘1168’))) AND wp_posts.post_type = ‘member’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘acf-disabled’ OR wp_posts.post_status = ‘archive’ OR wp_posts.post_status = ‘future’ OR wp_posts.post_status = ‘draft’ OR wp_posts.post_status = ‘pending’ OR wp_posts.post_status = ‘private’ OR wp_posts.post_status = ‘archive’)”
here is the query which doesn’t works (author user):
string(506) ” AND wp_posts.post_author IN (826) AND wp_posts.post_type = ‘member’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘acf-disabled’ OR wp_posts.post_status = ‘archive’ OR wp_posts.post_status = ‘future’ OR wp_posts.post_status = ‘draft’ OR wp_posts.post_status = ‘pending’ OR (wp_posts.post_author = 826 OR (wp_term_taxonomy.taxonomy = ‘author’ AND wp_term_taxonomy.term_id = ‘1168’)) AND wp_posts.post_status = ‘private’ OR wp_posts.post_author = 826 AND wp_posts.post_status = ‘archive’)”
Does someone have an idea why?
https://www.ads-software.com/plugins/co-authors-plus/
]]>1. My table does not show little triangles on sortable columns. It only highlights the column title;
2. The table shows two (orange) rectangle blocks in 1st and 2nd column (I made the 2nd column as the primary column in setting
$this->_column_headers);
3. The actions for the first column always show on the screen, rather than only shown when the cursor is hovering on the value of the column.
4. Hidden columns does not seem to work.
Here is a screenshot of how does my table look.
Any advice and/or suggestion will be greatly appreciated
]]>https://www.ads-software.com/plugins/backupwordpress/
]]>I’ve got a custom post type ( xxx ), with some custom metaboxes, everything works perfectly.
On the admin panel for that post_type ( edit.php?post_type=xxx ), i’ve got a tracker in my Url ( edit.php?post_type=xxx&tracker=007 ).
This tracker refers to a postmeta for those post type.
I would like to display in the table, the posts that matchs this tracker. I’ve found a kind of solution with WP_list_table class, but the main problem is that method need to add a menu item with add_menu_page. Since i’ve got post type, i already have a menu item, so don’t need to add an another.
I also tried to use posts_clauses hook, but that won’t work because it can’t change the FROM clause to use postmeta as well.
Is there a way to tell wordpress to display those posts IF Something ( postmeta = 007 here ) ?
Thanks for thinking about it guys !
]]>