C450104
Forum Replies Created
-
Forum: Hacks
In reply to: Sort Admin edit.php Post List By Modified Instead of PublishedI think I’ll probably be using this guide to expand the functionality of my custom fields by adding them to the Quick Edit section of my site:
https://shibashake.com/wordpress-theme/expand-the-wordpress-quick-edit-menu…And I’m just posting this here for posterity’s sake.
Forum: Hacks
In reply to: Sort Admin edit.php Post List By Modified Instead of PublishedWoot! My issue is resolved! Found something that does what I needed:
https://www.ads-software.com/extend/plugins/custom-admin-column/This came with 2 default new columns that it added to the Posts page that I didn’t really need, but gave me the plugin framework I needed to tweak and add what I wanted.
For anyone coming after me, in the custom_admin_columns.php file, find:
function cac_post_column_filter($columns) { $columns['thumbnail'] = 'Featured Image'; $columns['slug'] = 'Permalink'; return $columns; } add_filter('manage_post_posts_columns', 'cac_post_column_filter');
After
$columns['slug'] = 'Permalink';
Add:
$columns['date_modified'] = 'Date Modified';
Then find:function cac_column_value($name, $id){ switch($name){ case 'slug': $permalink = get_permalink($id); echo '<a href="'. $permalink . '" target="_blank">' . $permalink . '</a>'; break; case 'thumbnail': if(function_exists('get_the_post_thumbnail')) echo get_the_post_thumbnail($id, array(75,75)); break;
After the Thumbnail case, add:
case 'date_modified': if(function_exists('the_modified_date')) echo the_modified_date(); break;
Reference: https://codex.www.ads-software.com/Function_Reference/the_modified_date
I also added a few other custom post field columns to my file from using ADV Custom Fields:
https://www.ads-software.com/extend/plugins/advanced-custom-fields/If anyone ever wants to know how I’ve implemented those, feel free to email me or reply to this post, I’m subscribed.
Forum: Hacks
In reply to: Sort Admin edit.php Post List By Modified Instead of PublishedOk, so still digging for answers, found this page:
Curtiss Grymala Member Posted 8 months ago
Obviously, you shouldn’t actually modify edit.php, as any changes will be overwritten when you upgrade WordPress.
However, you can try to use the manage_posts_columns filter to add a new column showing the scheduled/published time.Which lead me to this:
https://scompt.com/blog/archives/2007/10/20/adding-custom-columns-to-the-wordpress-manage-posts-screenIt doesn’t have an example of my specific need, but I’ll keep looking to see if I stumble onto something.
So now at least I know I shouldn’t be messing with the edit.php or any other files like that.