Searching users with WP_List_Table plugin

Brian is correct. By changing the form to use get instead of post and then using $_REQUEST to fetch it should work, and is for me. // Fetch, prepare, sort, and filter our data. if( isset( $_REQUEST [“s”] ) ){ // Form that displays the table and also contains the search_box() <form id=”table-class-filter” method=”get” class=”table-class-admin-form”>

‘username_exists’ still returns an ID even after deleting record from the database?

By default, WordPress uses $wp_object_cache which is an instance of WP_Object_Cache to save on trips to the database. Trace back username_exists() function, you will notice that get_user_by() uses WP_User::get_data_by() which return user data from $wp_object_cache immediately without checking if that user exists in database. Note that $wp_object_cache is stored in memory. It means that if … Read more

How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table

Look at this code public function column_default( $item, $column_name ) { switch ( $column_name ) { case ‘address’: case ‘city’: return $item[ $column_name ]; default: return print_r( $item, true ); //Show the whole array for…. } } Since you are only trying to render user_id , browser and ip_address and those are not available in … Read more

How to disable `SQL_CALC_FOUND_ROWS` [duplicate]

First should only disable SQL_CALC_FOUND_ROWS if you aren’t using pagination, to do so set parameter no_found_rows to true in WP_Query. WP_Query( array( ‘no_found_rows’ => true ) ); Note get_posts() does that by default.

How to use update and delete query in wordpress

About UPDATE+INSERT: I have made a function for myself, and might help you too, i.e. : UPDATE_OR_INSERT(‘wp_users’, array(‘gender’=>’female’), array(‘name’=>’Monika’) ); that will UPDATE A VALUE in column (where name=monika), but in case that value doesnt exists, then it creates a new record in DB. Why this is necessary? because As far as i know, there … Read more

Get posts by menu ID

I recently needed the same thing, I had menu of categories and I needed to get the categories that in the menu. After a several hours digging in the WP core, I found the wp_get_nav_menu_items() function that helped me. I finnally came with this, 220 was my menu_id $navcat = wp_get_nav_menu_items(‘220’); foreach ($navcat as $obj) … Read more

Can I use MariaDB instead of MySQL in wordpress?

To answer your exact questions: Yes. Just use MariaDB instead of MySQL. No, it is a straight replacement. The exact details depend heavily upon your exact situation. However, MariaDB is marketed as a compatible MySQL replacement. AFAIK, it works with WordPress with no changes at all.

WordPress MySQL & PHP Performance

Hi Matthew Paulson, I see your using W3 Total Cache but your database and object cache is set to disk. Caching objects and your database to disk can actually have a negative performance effect especially if your getting that much traffic. You can read more about the effects on caching database and objects to disk … Read more