Sortable admin columns, when data isn’t coming from post_meta
See the follow-up post: http://scribu.net/wordpress/sortable-taxonomy-columns.html
See the follow-up post: http://scribu.net/wordpress/sortable-taxonomy-columns.html
This “feature” has been in WP for quite a while. You can disable it by installing this small plugin: http://wordpress.org/extend/plugins/category-checklist-tree/
The code from ThinkVitamin is right. I think the problem came from else where in your code. Actually, the hook manage_edit-${post_type}_columns takes an argument $columns which is an array of all registered columns. To add a new column, just add a new element to this array, like this: add_filter(‘manage_edit-film_columns’, ‘my_columns’); function my_columns($columns) { $columns[‘views’] = … Read more
As a rule of thumb, always remove the ending ?> of your .php files, especially if it’s a functions or config file that gets parsed before headers are sent to the page. If after that ?> you accidentally add a space, a tab character or a new line, there’s your invisible error.
Yes I recently ran into the situation where I wanted to change the profile link in the user-info section of the admin bar. The problem is that you can only get all nodes, add and remove them. Not edit. And you also cannot modify the $wp_admin_bar->nodes property due it is private. When easily removing and … Read more
The show_in_admin_all_list parameter in the register_post_status() function, determines if a given post status is included in the All post table view. Probably the shortest version is: add_action( ‘init’, function() use ( &$wp_post_statuses ) { $wp_post_statuses[‘draft’]->show_in_admin_all_list = false; }, 1 ); but let’s avoid modifying the globals directly like this and override the default draft status … Read more
Absolutely! That’s exactly what I’ve been doing for months now. (There are some screenshots here to show you what’s possible.) Just create a Custom Post Type for your their products, and then use a plugin to allow to you create Custom Metaboxes with fields. Here’s a list to consider: Plugins for Fields & Metaboxes The … Read more
Use the admin_enqueue_scripts hook instead of admin_init Note: you should use hooks that target admin pages as specifically as possible. e.g.: Plugins: Use the admin_print_scripts-{plugin-page} hook Themes: Use the admin_print_scripts-{theme-page} hook (where {theme-page} is whatever string you use in the add_theme_page() call) Custom Post-Type Edit Page: Use the admin_print_scripts-edit.php hook, For Custom Post Types, inside … Read more
From this Q&A, I’ve learned about the global variable $wp_meta_boxes. And over there is also the code to remove the default meta boxes. After examining the variable, this is the code I wrote to remove all Dashboard Widgets, including the ones added by plugins: add_action(‘wp_dashboard_setup’, ‘wpse_73561_remove_all_dashboard_meta_boxes’, 9999 ); function wpse_73561_remove_all_dashboard_meta_boxes() { global $wp_meta_boxes; $wp_meta_boxes[‘dashboard’][‘normal’][‘core’] = … Read more
I just ran into this situation. Here is a function I used to undo wpautop. I might be missing something, but this is a good start: function reverse_wpautop($s) { //remove any new lines already in there $s = str_replace(“\n”, “”, $s); //remove all <p> $s = str_replace(“<p>”, “”, $s); //replace <br /> with \n $s … Read more