Articles of wp list table

remove $_GET-parameter from WP_List_Table::tablenav

I’m using URL parameters as actions links within a custom WP_List_Table for users like so: http://domain.com/wp-admin/users.php?page=account-expiration-status&do_action_xyz&email=email%40domain.com&_wpnonce=xyz Within the parent class, I’m checking for the existence of array_key_exists( ‘do_action_xyz’, $_GET ) to trigger the appropriate functions. This works fine, but unfortunately the $_GET-parameters get added to the paginations links of the table as well. This causes […]

Odd behaviour for the update button when displaying a WP_List_Table

I am currently trying to add a WP_List_Table to a metabox in the edit page of a custom type. The code is currently class Post_Table extends WP_List_Table { public function __construct() { parent::__construct([ ‘singular’ => __( ‘Post’, ‘sp’ ), ‘plural’ => __( ‘Posts’, ‘sp’ ), ‘ajax’ => false ]); } function get_columns(){ $columns = array( […]

“Add New” button on custom post type grid

I’ve created a custom page in my wp-admin panel to show my custom model in a grid. It extends wp_list_table, and the grid works great with sorting and pagination. I’m having trouble adding an “Add New” button above the grid, however. I’ve added the button: <a href=”admin.php?page=certificates&amp;action=new” class=”add-new-h2″>Add New</a> And it takes me to the […]

Can I simplify in function column_default use of queries

In below function column_default I have several cases doing almost the same query. Is it possible to use only 1 query for all the 3 cases? And if so how do I use it in below example? Thanks for helping me. function column_default($item, $column_name){ global $wpdb; /* if ( ! in_array( $column_name, [‘id’, ‘user_id’, ‘user_email’, […]

Programatically inserted posts not showing in Posts Table

I’m trying to insert a custom post through a form. It’s a brief post, most content are custom meta fields updated with add_post_meta. So far, post inserting is working fine, except for a detail. This is the post insert query I’m doing: $venta = wp_insert_post(array( ‘post_name’ => “venta-$stamp”, ‘post_title’ => “Venta $stamp”, ‘post_type’ => ‘venta’, […]

Best Alternative to WP List Table

According to Codex they are not recommended uss WP List Table. So what is the best alternative to WP List Table?

Add acf field in title (admin table)

I want to add an ACF field in my post title, only on admin table (not in the title field stored in database), and only for a specific Custom Post Type. Some of my posts have the same name, so it will be more useful to have this information. In final, my title will look […]

WP_List_Table bulk actions notice & warning

I have own class which extends WP_List_Table class and everything works just fine but bulk actions have some issue. They performs well (delete the row in the table, change state of the item etc.) however while they reloads it feils with following errors and notices: Notice: Undefined offset: 0 in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/functions.php on line 773 Notice: […]

Add search bar to Custom Database Table in WordPress Dashboard

I have built a custom table within the WordPress database. From there I have put together a plugin which creates a dashboard page allowing you to view the various rows within the database by extending the WP_List_Table function. What I need to do now is add a search bar functionality. I have been able to […]

Possible to add a statement to a core file?

I would like to add one line to a wp core file. Basically on the ‘edit.php’ page, just right above <?php include(‘./admin-footer.php’); I would like to add an php include statement… include(‘./custom-file.php’); The custom-file is located inside a plugin, not a theme… so if I write it inside my plugin function.php, the url will be: […]