This filter is applied to the MySQL query before it is sent to MySQL server.
$query is the query text, $table_id is the table identifier from the MySQL table (wp_wpdatatables).
Also take a look at this documentation where you can find some useful filters which can be defined by user.
We have also have documentation about actions so I suggest you to take a look at this too.
Here is a videowhere you can see how to use them.
I hope you can find what are you trying to achieve.
Example:
You can change the possible values to 0 and 1 for example select box or checkbox filter and then using jQuery change text of these filter values from 1 to Yes and from 0 to No.
You can do this using jQuery text() function. Just change Selecter from this example with your filters selecter:
('#table_1 > tfoot > tr > td.header.sort._newcolumn_1 > span > div > div > span.selecter-item.selected').text('Yes');
How to rename values for display only, e.g. replace INT value 1 in database with 'yes' in datatable, INT value 0 in database with datatable 'no'?
Or VARCHAR value NULL in database with datatable - (dash)?
Hi Frank,
Thank you for your purchase.
I can suggest you to use this filter exactly for mysql
wpdatatables_filter_mysql_query( $query, $table_id )
This filter is applied to the MySQL query before it is sent to MySQL server. $query is the query text, $table_id is the table identifier from the MySQL table (wp_wpdatatables).
Also take a look at this documentation where you can find some useful filters which can be defined by user. We have also have documentation about actions so I suggest you to take a look at this too.
Here is a video where you can see how to use them. I hope you can find what are you trying to achieve.
Example:
You can change the possible values to 0 and 1 for example select box or checkbox filter and then using jQuery change text of these filter values from 1 to Yes and from 0 to No.
You can do this using jQuery text() function. Just change Selecter from this example with your filters selecter:
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables