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:52:58 | 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> | |||
Added: [php] | |||
Added: /*----------- ------------- ------------ ------------- ------------ ----------------------*/ | |||
Added: /* CUSTOM ORDER A CUSTOM POST TYPE IN THE WP ADMIN EDIT.PHP SCREEN */ | |||
Added: /*----------- ------------- ------------ ------------- --------------------*/ | |||
Added: function posts_for_current_ author($query) { | |||
Added: if($query->is_admin) { | |||
Added: if ($query->get( 'post_type') == 'articles') | |||
Added: { | |||
Added: $query->set('orderby', 'date'); | |||
Added: $query->set('order', 'DESC'); | |||
Added: } | |||
Added: } | |||
Added: return $query; | |||
Deleted: | Added: } | ||
Added: add_filter('pre_get_posts', 'posts_for_current_author'); | |||
Added: [/php] |
Note: Spaces may be added to comparison text to allow better line wrapping.
No comments yet.