Is there a way to add desired columns such as postmeta field to quick edit
option without creating columns? I did this by calling method but i could’t make it work since those values are not saving could you walk through it once please guide me to achieve this.
as a heads up if you are using this on a hierarchical post type, then you must change post_row_actions to page_row_actions. got stuck on that for a while. and to touch back on my old comment about setting the thumbnail from the edit.php screen, i was able to accomplish this except that the new image wouldn’t fade in. i couldn’t find any way to hook onto the completion of the ajax save. still looking for the appropriate callback.
I have to get the current post meta inside the function and update the data with conditions of new and existing data. But seems like get_post_meta is not working. I tried this: get_post_meta($post_id, ‘_vm’, TRUE) while there is some existing data with meta key _vm but. It outputs nothing. It works good on other function. I need quick help.
Not sure why. It could be an issue with the wrong $post_id or that the meta key starts with an underscore. I would print out the $post_id to make sure it is the post that I want. If that is not the issue, I would try using a different meta key.
Sorry for late reply. That doesn’t work. The post id and meta key is accurate. I tried printing them and also tried with some other meta before doing the comment. It looks like the get_post_meta function doesn’t work inside the function for me. If you have time you may try. I used same code and data to get the meta data on edit post page and other places and that works fine.
Im struggling to follow this. the first bit add a custom column Widget Set to the admin I cant follow as you dont illustrate which file is needed to be edited. It would be easier if you pointed out edit the /wp-admin/admin.php file (or what ever file it is)
Im trying to just add a new field in the pages edit menu so that it will just display the page file name eg left-handed-widgets.html. ultimatly I just want to export a list of the page file names my site has. but dont want it in xml. just want a text file or CSV. cant find a plugin to to this anywhere. Ijust need to record on a table each page file name and its inherant google page rank. So I can get a at the glance view of which pages need a bit of sculpting.
does anyone know if there is a plugin that will do this. I could follow the instructions if didnt have to second guess while file is being edited. or is that just the arrogance of the person writing the tutorial “if your wanting to edit this code, then you should know what file we are using, else get lost” how much extra effort does it take to just put in a step that says ‘open wp-admin/edit-xyz.php’ .
In general, you do not want to edit WordPress core files.
The best ways to add in new functionality is through a child theme or through a plugin. Some people edit their current theme file for a short term solution.
Great! I had been looking for this since a long time! I needed a way to set my custom fields without opening up the post edit screen, but couldn’t find one. And then I came across this post when I was reading your http://shibashake.com/wordpress-theme/custom-post-type-permalinks post.
hi! i love this. i just noticed that when you update the post after quick editing the ‘widget set’.. that if you go back to the quick edit, the drop down doesn’t remember the value. this probably b/c there is no comparison of the the current value to the value in the foreach loop
foreach ($widget_sets as $widget_set) {
echo "ID}'>{$widget_set->post_title}\n";
}
and setting selected=”selected”. though there might be more to the javascript side of things
thumbs up to Jan’s idea! i also have been wondering for a while if the thumbnail (added from your other tutorial) could be changed/set from the quick edit menu.
I get these errors in the Firebug console when I use this code. Clicking the quick edit link doesn’t work when I use my copied and pasted version of the code.
Thank you so much for this tutorial! You are amazing.
I think there’s a typo, in the last bit of code:
It looks like you have an extra “)” here:
// Add to our admin_init function
add_filter(‘post_row_actions’, ‘shiba_expand_quick_edit_link’), 10, 2);
You are my hero – the only person I could find that may have a chance at helping me!
Is there any way you would take a paying job to help me create a column in my wp-admin post screen? I just installed the la petite URL plugin, and want the shortened URL’s to display on my main admin posts screen (for quick reference). I don’t need it in the quick edit function – just a column that displays the link/data.
Please contact me at the email I put into the comment. Thanks!
This was an amazing article! I’m still fairly new to WordPress, so I’m learning as much about cutomizing it and using it as I can. This was some great info for me; it is helping me to better understand the programming side of WordPress, since I am trained more on the graphic side
- any idea how to add a username in a link?
for exampe. site url: http://mysite.com/
now adding a username makes it http://mysite.com/username
note. ...
Hi, your code is really magic but i’m not a php expert developer, is there a way to insert custom fields instead the ID post?
I need to show the 3 custom field options into the “option” form.
I’m using this:
'lotes',
'numberposts' => -1,
'post_status' => 'publish') );
?>
Inside the form:
<?php
foreach ($estatus_columns as $estatus_column) {
echo "ID}'>{$estatus_column->post_title}\n";
}
?>
I’m trying to do this with no success:
Inside the form:
<?php
foreach ($estatus_columns as $estatus_column) {
echo "estatus}'>. get('estatus') .\n";
}
?>
Thank you in advance.
Very interesting work, I was wondering if there is a way to remove items from quick edit, for example the categories box?
There is no easy way that I know of. Here is the inline_edit function for posts. There may be some place to hook into to stop certain input elements from rendering.
http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-admin/includes/class-wp-posts-list-table.php.source.html#l689
HI Shiba,
Is there a way to add desired columns such as postmeta field to quick edit
option without creating columns? I did this by calling method but i could’t make it work since those values are not saving could you walk through it once please guide me to achieve this.
Hey I found solution we can create columns as many as we want without creating columns by calling foreign method to quick edit save anyways –thanks
as a heads up if you are using this on a hierarchical post type, then you must change post_row_actions to page_row_actions. got stuck on that for a while. and to touch back on my old comment about setting the thumbnail from the edit.php screen, i was able to accomplish this except that the new image wouldn’t fade in. i couldn’t find any way to hook onto the completion of the ajax save. still looking for the appropriate callback.
I have to get the current post meta inside the function and update the data with conditions of new and existing data. But seems like get_post_meta is not working. I tried this: get_post_meta($post_id, ‘_vm’, TRUE) while there is some existing data with meta key _vm but. It outputs nothing. It works good on other function. I need quick help.
Not sure why. It could be an issue with the wrong $post_id or that the meta key starts with an underscore. I would print out the $post_id to make sure it is the post that I want. If that is not the issue, I would try using a different meta key.
Anyway, let us know what works out.
Sorry for late reply. That doesn’t work. The post id and meta key is accurate. I tried printing them and also tried with some other meta before doing the comment. It looks like the get_post_meta function doesn’t work inside the function for me. If you have time you may try. I used same code and data to get the meta data on edit post page and other places and that works fine.
Im struggling to follow this. the first bit add a custom column Widget Set to the admin I cant follow as you dont illustrate which file is needed to be edited. It would be easier if you pointed out edit the /wp-admin/admin.php file (or what ever file it is)
Im trying to just add a new field in the pages edit menu so that it will just display the page file name eg left-handed-widgets.html. ultimatly I just want to export a list of the page file names my site has. but dont want it in xml. just want a text file or CSV. cant find a plugin to to this anywhere. Ijust need to record on a table each page file name and its inherant google page rank. So I can get a at the glance view of which pages need a bit of sculpting.
does anyone know if there is a plugin that will do this. I could follow the instructions if didnt have to second guess while file is being edited. or is that just the arrogance of the person writing the tutorial “if your wanting to edit this code, then you should know what file we are using, else get lost” how much extra effort does it take to just put in a step that says ‘open wp-admin/edit-xyz.php’ .
In general, you do not want to edit WordPress core files.
The best ways to add in new functionality is through a child theme or through a plugin. Some people edit their current theme file for a short term solution.
There are a variety of articles out there on child themes and how to write a plugin. I would start with the WordPress Codex. I also have an example plugin that you can use -
http://shibashake.com/wordpress-theme/wordpress-example-plugin
I can understand your frustration with WP programming, but striking out at others is perhaps not the best way to get questions answered.
Great! I had been looking for this since a long time! I needed a way to set my custom fields without opening up the post edit screen, but couldn’t find one. And then I came across this post when I was reading your http://shibashake.com/wordpress-theme/custom-post-type-permalinks post.
Thanks! You rock!
-Rutwick
nm. i must have messed something up while trying to expand it to my own purposes. sweet.
hi! i love this. i just noticed that when you update the post after quick editing the ‘widget set’.. that if you go back to the quick edit, the drop down doesn’t remember the value. this probably b/c there is no comparison of the the current value to the value in the foreach loop
foreach ($widget_sets as $widget_set) {
echo "ID}'>{$widget_set->post_title}\n";
}
and setting selected=”selected”. though there might be more to the javascript side of things
thumbs up to Jan’s idea! i also have been wondering for a while if the thumbnail (added from your other tutorial) could be changed/set from the quick edit menu.
I get these errors in the Firebug console when I use this code. Clicking the quick edit link doesn’t work when I use my copied and pasted version of the code.
ReferenceError: Can’t find variable: inlineEditPost
ReferenceError: Can’t find variable: set_inline_widget_set
Where are you trying to add the quick edit expansion? What version of WP are you running?
inlineEditPost should be defined in inline-edit-post.js (a native WP file) which automatically gets loaded in the Edit Post screen.
Thank you so much for this tutorial! You are amazing.
I think there’s a typo, in the last bit of code:
It looks like you have an extra “)” here:
// Add to our admin_init function
add_filter(‘post_row_actions’, ‘shiba_expand_quick_edit_link’), 10, 2);
Do you know if this is possible for custom post types?
nvm
You are my hero – the only person I could find that may have a chance at helping me!
Is there any way you would take a paying job to help me create a column in my wp-admin post screen? I just installed the la petite URL plugin, and want the shortened URL’s to display on my main admin posts screen (for quick reference). I don’t need it in the quick edit function – just a column that displays the link/data.
Please contact me at the email I put into the comment. Thanks!
Hello Perry,
I don’t work on external projects but here is a tutorial on adding admin columns -
http://shibashake.com/wordpress-theme/add-admin-columns-in-wordpress
It should be much easier to add admin columns than to expand the quick edit menu.
This was an amazing article! I’m still fairly new to WordPress, so I’m learning as much about cutomizing it and using it as I can. This was some great info for me; it is helping me to better understand the programming side of WordPress, since I am trained more on the graphic side
I think I love you
Thanks so much for this.. I can’t tell you how much help this was for me.
With more appreciation than you could shake a stick at..
Michael.
LOL! Well love is great and all but diamonds are a girl’s best friend.
I wonder if you could use it to add a “quick edit” button to the Media Library? It would be very useful to modify the captions and alts from there…
Thanks!
That is a good idea. I will add that to my to-do list.
Thanks – You’re article helped a lot understanding and using quickedit.
greets from Salzburg,
- johannes
Glad it was helpful. Nice photographs on your site.