Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom post type for products and a custom meta checkbox field for 'Sold'. How can I show the Sold status in a column on the Products edit list and make it sortable (so it would sort all the sold items together) or filter them by the Sold status?

share|improve this question
add comment

1 Answer

i did something similar with some radio buttons and a special taxonomy. i worked almost exclusively from the following 2 tutorials:

http://shibashake.com/wordpress-theme/expand-the-wordpress-quick-edit-menu http://scribu.net/wordpress/sortable-taxonomy-columns.html

though i was working with a taxonomy, the scribu tutorial actually links to another scribu tutorial on sorting by meta, which is more in-line w/ the OP's question:

http://scribu.net/wordpress/custom-sortable-columns.html

share|improve this answer
    
Useful, but doesn't answer the question. –  AlxVallejo Jul 13 '12 at 17:35
    
the OP asked how to add meta information to the edit list? the first article covers that. the second article covers how to make columns sortable, though i'd agree that the article it links to: custom sortable columns is more appropriate. so i'll amend my answer. –  helgatheviking Jul 14 '12 at 22:04
    
I interpreted that the returned meta value should also be given a checkbox for quick edit. Getting a post_meta does not set the checkbox to true also. It validates the value but you must set the checkbox value to 'checked'. The example provides a simple db lookup, whereas a checbox holds a value that is serialized in php –  AlxVallejo Jul 15 '12 at 0:42
    
ok, i didn't get that. there are only 2 sentences to the question and the OP seems gone so i guess we'll never know exactly what he was going for. i didn't feel like putting a lot of effort into answering a question that didn't appear to show alot of effort. –  helgatheviking Jul 16 '12 at 2:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.