Highlight custom widgets in the admin area?

All widgets in the admin area get an id in the style widget-[global_counter]_[widget_key]-[widget_id], like widget-59_monkeyman_widget_shortcut-5 (installed widget) or widget-11_monkeyman_widget_shortcut-__i__ (an uninstalled widget in the list). If your widget key contains something unique for all your widgets (like your company name), you can use this and add a substring attribute CSS selector (which works in most … Read more

How to list ALL Pages in the dashboard?

If that listing has too many pages, maybe you’ll run into troubles. You probably already know that this can be set in the Screen Options of the page http://example.com/wp-admin/edit.php?post_type=page. If you try to put a really high value there, this warning pops up and the system doesn’t accept it: But the following permanently sets this … Read more

What is the best method to close off the backend?

If you know the sub-net of your VPN you could restrict access to /wp-admin via .htaccess using standard Apache rules. <Directory /var/www/wp-admin/> Order deny,allow Allow from 192.168.1.0/24 Allow from 127 </Directory> Obviously you’d need to adjust the directory and IP address subnet to suit your needs. To restrict access to a specific file: <Files _FILE_.php> … Read more

how do I force a single column layout in screen layout

You can use the filter screen_layout_columns to set only one column for the post screen get_user_option_screen_layout_post to force the user option to 1. If you want to use that for custom post type then use get_user_option_screen_layout_{post_type} The following code will do it: function so_screen_layout_columns( $columns ) { $columns[‘post’] = 1; return $columns; } add_filter( ‘screen_layout_columns’, … Read more

sortable custom column in media library

You cannot do a sort on the attachment meta data specifically because it’s stored in a serialized string. Whilst WP_Query can sort on meta values it can’t sort on data that’s serialized. For example wp_get_attachment_metadata fetches and unserializes that for you inside the column callback, but MySQL queries can’t sort on that type of data. … Read more

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