custom field not showing properly in admin
-
Hi,
I wondered if you can help me because I’m thinking that I may need a different call to display the selected custom checkbox field in admin, the column shows as does the “-” when the field is empty, however it will not show the actual selected field when it isn’t, so I thought perhaps it may need a slight tweak with it being a checkbox over a text field?
Here’s what I have
add_filter("manage_edit-advert_columns", "seller_type", 20); function seller_type( $columns ) { $columns["seller_type"] = "Seller Type"; return $columns; } add_action("manage_advert_posts_custom_column", "ad_seller_type", 10, 2); function ad_seller_type( $column, $post_id ) { if($column == "seller_type") { $cf = get_post_meta( $post_id, 'seller_type', true ); if(empty($cc)) { echo "<em>-</em>"; } else { echo "<strong>".$cc."</strong>"; } } }
And I think it may be this bit which needs editing (but I’m no expert and I wouldn’t know what it might need editing to)
echo "<strong>".$cc."</strong>";
Thank you
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘custom field not showing properly in admin’ is closed to new replies.