WordPress last login foreach user

This will add a new column to the Users admin and show their last login. <?php /* Plugin Name: (#158276) WPSE | Last user login */ // Add user meta `last_login` that saves the UNIX time stamp // to identify the exact time when a user logged in add_action( ‘wp_login’, ‘add_login_time’ ); function add_login_time( $user_login … Read more

Custom Post type sort order not working in the admin area

The ‘title’ and ‘date’ columns are WordPress default tables (even for CPTs) so they should be automatically sortable, unless those columns have been replaced. For custom columns there is a hook for registering a column as ‘sortable’: https://developer.wordpress.org/reference/hooks/manage_this-screen-id_sortable_columns/ //Filter is ‘manage_edit-{custom post type}_sortable_columns //or more generally ‘manage_{screen id}_sortable_columns add_filter( ‘manage_edit-cpt_sortable_columns’, ‘wpse221267_cpt_sortable_columns’ ); function wpse221267_cpt_sortable_columns( $columns … Read more

WooCommerce: Add New Report Tab

add_filter(‘woocommerce_admin_reports’,’custom_tab’); function custom_tab($reports) { $reports[‘custom_tab’]= array( ‘title’=>__(‘Custom Reports’,’woocommerce’), ‘description’=> ‘WooCommerce Orders Listing Here…’, ‘hide_title’=> true, ‘callback’=>array(‘wc_admin_orders_customers’, ‘display_orders_list_cusotomers’) ); return $reports; }

Better search for WordPress admin backend [closed]

The Search Everything plugin works pretty well for me on the front end. I’ve never tried it, but you should be able to fork it and add is_admin() conditionals to all of the functions it uses. Or better yet, just allow the frond-end to be search-able too. A visitor who can find what they are … Read more

Add column to pages table

Also an tutorial with an solution for page and post to add thumbnail in a column: http://wpengineer.com/1960/display-post-thumbnail-post-page-overview/ Change the content from thumbnail to your content and remove the hooks for post: // for posts // add_filter( ‘manage_posts_columns’, ‘fb_AddThumbColumn’ ); // add_action( ‘manage_posts_custom_column’, ‘fb_AddThumbValue’, 10, 2 ); // for pages add_filter( ‘manage_pages_columns’, ‘fb_AddThumbColumn’ ); add_action( ‘manage_pages_custom_column’, … Read more

Making the thumbnails in the backend Media section bigger

I don’t see any way of hooking into this. Following the lead of wp_get_attachment_image takes nowhere… // wp-admin/includes/class-wp-media-list-table.php // line 200 case ‘icon’: $attributes=”class=”column-icon media-icon”” . $style; ?> <td <?php echo $attributes ?>><?php if ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) { if ( $this->is_trash || ! $user_can_edit ) { … Read more