Download the PHP package wpbones/wptables without Composer
On this page you can find all versions of the php package wpbones/wptables. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wpbones/wptables
More information about wpbones/wptables
Files in wpbones/wptables
Package wptables
Short Description A fluent implementation of WordPress WP List Table for WP Bones
License MIT
Homepage https://github.com/wpbones/wptables
Informations about the package wptables
WP Tables for WP Bones

A fluent implementation of WordPress WP List Table for WP Bones
Requirements
This package works with a WordPress plugin written with WP Bones framework library.
Installation
You can install third party packages by using:
I advise to use this command instead of composer require because doing this an automatic renaming will done.
You can use composer to install this package:
You may also to add "wpbones/wptables": "^1.1" in the composer.json file of your plugin:
and run
How to
You can use WP Tables either like subclass or like fluent class instance.
Subclassing
As subclass class instance you may create a your own class as show below:
In your view controller you have to use the load method in order to register the screen options:
In your ExampleTable you may override:
This will be the value used in the checkbox value.
Bulk actions
getBulkActionsForView() lists the actions of the drop-down menu, and a method named after each one runs it: the keep_on_trash action calls processBulkActionKeepOnTrash(), with the checked values.
The method runs only when the request carries the nonce that the table form prints (bulk-{plural}). The form is sent with GET, which the CSRF check of WP Bones 3 does not cover, so the table checks it itself: a request without the nonce, as a link from another site would be, shows "The link you followed has expired." and runs nothing. Since 1.1.0.
A link of your own that runs one of these actions, a row action for example, has to carry the same nonce. Inside the table class, sign it with wp_nonce_url( $url, 'bulk-' . $this->_args['plural'] ). To check a nonce of your own instead, override isValidBulkActionNonce().
Fluent
If you like use the WPTable as fluent instance, you have to set the columns twice.