Add column to plugins table screen

First, you have to add the custom column to the plugin column names: function wpa65189_add_plugins_column( $columns ) { $columns[‘wpa65189_column’] = ‘wpa65189 Custom Column’; return $columns; } add_filter( ‘manage_plugins_columns’, ‘wpa65189_add_plugins_column’ ); Then output your column data for your plugin: function wpa65189_render_plugins_column( $column_name, $plugin_file, $plugin_data ) { if ( ‘wpa65189_column’ == $column_name && ‘My Plugin Name’ == … Read more

Sorting custom admin column by value

Ah, the remedy was a simple one: function issue_column_orderby( $vars ) { if ( isset( $vars[‘orderby’] ) && ‘linked_issue_post’ == $vars[‘orderby’] ) { $vars = array_merge( $vars, array( ‘meta_key’ => ‘article_issue_n’, ‘orderby’ => ‘meta_value’ ) ); } return $vars; } add_filter( ‘request’, ‘issue_column_orderby’ ); I probably omitted something before…

Sorting taxonomy columns by meta value numeric

The code I am posting is a modified and simplified version of yours. I got my solution using your code. /** * Filter WP_Term_Query meta query * * @param object $query WP_Term_Query * @return object */ function filter_terms_clauses( $pieces, $taxonomies, $args ) { global $pagenow, $wpdb; if(!is_admin()) { return $pieces; } if( is_admin() && $pagenow … Read more

How to remove Gravatar from Username column

Since there is no special avatar column to unset (the avatars are inside the username column), you could try instead to hide the avatars via css: function hide_avatars_wpse_94126() { if(!current_user_can(‘manage_options’)){ // hide only for non-admins echo “<style>.users td.username img.avatar{display:none !important;}</style>”; } } add_action(‘admin_head-users.php’,’hide_avatars_wpse_94126′); where they are hidden for non-admins. The result will be like this:

Remove hyperlink to edit post in edit.php

You can remove the a tag with javascript, short and easy. Use the follow plugin; include a small script in the footer of the edit.php, only this page in backend of WP and remove all a-tag inside the table; see the selector on the source below. <?php /** * Plugin Name: Remove a * Version: … Read more

Add column for attachment file size

Working code: // Add custom column with file size info to attachment page add_filter( ‘manage_media_columns’, ‘bb2_manage_media_columns’, 10, 2 ); function bb2_manage_media_columns( $columns ) { $columns[‘filesize’] = __( ‘Storlek’, ‘bb2’ ); return $columns; } add_action( ‘manage_media_custom_column’, ‘bb2_manage_media_custom_column’, 10, 2 ); function bb2_manage_media_custom_column( $column_name, $id ) { switch ( $column_name ) { case ‘filesize’ : $bytes = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)