Revisions
- May 1, 2012 @ 01:56:15 [Current Revision] by PeterLugg
- May 1, 2012 @ 02:01:19 [Autosave] by PeterLugg
- May 1, 2012 @ 01:55:53 by PeterLugg
- May 1, 2012 @ 01:55:03 by PeterLugg
- May 1, 2012 @ 01:52:58 by PeterLugg
Revision Differences
May 1, 2012 @ 01:55:03 | Current Revision | ||
---|---|---|---|
Content | |||
Added: This is a function to do it easily: | |||
Added: This might be better: <a href="http:// scribu.net/wordpress/custom- sortable-columns.html">http: //scribu.net/ wordpress/custom- sortable-columns.html</a> | |||
Deleted: [php]</pre> | Added: [php] | ||
Unchanged: /*----------- ------------- ------------ ------------- ------------ ----------------------*/ | Unchanged: /*----------- ------------- ------------ ------------- ------------ ----------------------*/ | ||
Unchanged: /* CUSTOM ORDER A CUSTOM POST TYPE IN THE WP ADMIN EDIT.PHP SCREEN */ | Unchanged: /* CUSTOM ORDER A CUSTOM POST TYPE IN THE WP ADMIN EDIT.PHP SCREEN */ | ||
Unchanged: /*----------- ------------- ------------ ------------- --------------------*/ | Unchanged: /*----------- ------------- ------------ ------------- --------------------*/ | ||
Unchanged: function posts_for_current_ author($query) { | Unchanged: function posts_for_current_ author($query) { | ||
Unchanged: if($query->is_admin) { | Unchanged: if($query->is_admin) { | ||
Unchanged: if ($query->get( 'post_type') == 'articles') | Unchanged: if ($query->get( 'post_type') == 'articles') | ||
Unchanged: { | Unchanged: { | ||
Unchanged: $query->set('orderby', 'date'); | Unchanged: $query->set('orderby', 'date'); | ||
Unchanged: $query->set('order', 'DESC'); | Unchanged: $query->set('order', 'DESC'); | ||
Unchanged: } | Unchanged: } | ||
Unchanged: } | Unchanged: } | ||
Unchanged: return $query; | Unchanged: return $query; | ||
Unchanged: } | Unchanged: } | ||
Unchanged: add_filter('pre_get_posts', 'posts_for_current_author'); | Unchanged: add_filter('pre_get_posts', 'posts_for_current_author'); | ||
Deleted: | Added: [/php] | ||
Deleted: |
Note: Spaces may be added to comparison text to allow better line wrapping.
No comments yet.