There's a completely new way now to hide dashboard items, and I finally think I found the easiest way to do it, after having to poke around looking for the right hooks. This basically applies the same set of "screen options" to every user regardless if they've customized it or not. It leaves only the "Right Now" and "Recent Drafts" on the dashboard, but feel free to customize this array by checking the name that you want to hide and adding it to the array.
Also you can easily add more options such as column layout and such by customizing it on a user account, going into the database and looking for the 'metaboxhidden_dashboard' and related keys in the usermeta table and force-applying those (which is essentially what I did here)
Just thought I'd share this little tidbit of information. It can be put in its own plugin or inside of an existing one, as long as the filter gets triggered you're good to go. I've got it working properly in 2.8.6 currently without an issue.
function hide_dashboard_stuff() {
$hide = array(
0 => 'dashboard_recent_comments',
1 => 'dashboard_incoming_links',
2 => 'dashboard_plugins',
3 => 'dashboard_quick_press',
4 => 'dashboard_primary',
5 => 'dashboard_secondary',
);
return $hide;
}
add_filter('get_user_option_metaboxhidden_dashboard', 'hide_dashboard_stuff', 1);
You can probably also use this for just Django + nginx on Ubuntu too, it should work the same for any Django-based package, just change the Transifex-specific stuff (like /site_media and such.)
Dependencies:
- python-django package from Ubuntu (currently Jaunty's 1.0.2-1ubuntu0.1)
- Transifex installed to /home/transifex/web/transifex, from source
- Transifex setup to answer over fastcgi on port 8080
- Tested on nginx 0.7.x and 0.8.x compiled from source
/etc/nginx/nginx.conf:
server {
listen 80;
server_name foo.com;
include /etc/nginx/confs/defaults.conf;
location / {
fastcgi_pass 127.0.0.1:8080;
include /etc/nginx/confs/django.conf;
}
location /site_media {
root /home/transifex/web/transifex;
include /etc/nginx/confs/expires.conf;
}
location /media {
root /usr/share/python-support/python-django/django/contrib;
include /etc/nginx/confs/expires.conf;
}
}
/etc/nginx/confs/defaults.conf:
location ~ /\.ht {
deny all;
}
location ~ \.svn {
deny all;
}
log_not_found off;
server_name_in_redirect off;
/etc/nginx/confs/django.conf:
# http://www.rkblog.rk.edu.pl/w/p/django-nginx/
# http://code.djangoproject.com/wiki/ServerArrangements
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
/etc/nginx/confs/expires.conf:
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
expires max;
access_log off;
}