New answers tagged

0

You should get total and result array separately. Total is to create the page numbers and result array will give you limited data for each pages. Refer the below code. if (isset($_POST['list_position']) && $_POST['list_position'] != 'Select by Position'){ $list_position= $_POST['list_position']; $totalPosition= $wpdb->get_var("SELECT ...


0

as per the answer given by Tim Malone, I have this working code: /* Activate Hook Plugin */ register_activation_hook(__FILE__, 'ulh_add_user_logins_table'); /* call when plugin is activated */ function ulh_add_user_logins_table() { global $wpdb; $charset_collate = $wpdb->get_charset_collate(); ...


1

register_activation_hook() only attaches a function to run on activation of your plugin, not on updating. See the docs for full details, particularly this part: 3.1 : This hook is now fired only when the user activates the plugin and not when an automatic plugin update occurs (#14915). Of course, you could force your hook to run by deactivating and ...


2

This is actually not that hard, but you will have to excuse me for keeping it high level because this is just a stupid thing to do as all things which are security by obscurity. All you need to do is write your WPDB driver, which inherits the WPDB class. Place it in /wp-content/db.php file and make sure to initialize the global $wpdb object with your class. ...


0

WordPress uses a single table prefix for all tables and I always set a different prefix for each site I build to improve security. You could tell your client that security is even better if you do this for all tables.


1

My choice would be to use WP_List_Table. If you continue reading the Codex it makes it clear that it is commonly used by third party code. "Someday" it might go away, but I doubt it will happen abruptly (if at all). If it does change, there will probably be a newer solution to replace it. EDIT: Another thought. if you feel really can't use WP_List_Table ...


1

Why not extend WP_List_Table? It creates responsive tables that collapse to an accordion when the table width exceeds the screen size. See Class Reference/WP List Table. You might take a look at the code in this plugin to get started: Custom List Table Example


-1

You can make tables responsive using CSS. I recommend applying a class to the , and referencing that class in CSS code setting dimensions to percentages. ...Something like will respond very well to .respond {width:100%; height: 100%}. If you want the responsiveness to be really awesome, you can address different devices explicitly in CSS using media ...



Top 50 recent answers are included