Abr
17
2017
How to Display post attachment count in admin column in WordPress
Sometimes you have a post with multiple attachments and it would be nice to see a count of the total media attached to a post. To see this you only need add this snippet to the functions.php
add_filter('manage_posts_columns', 'posts_columns_attachment_count', 5); add_action('manage_posts_custom_column', 'posts_custom_columns_attachment_count', 5, 2); function posts_columns_attachment_count($defaults){ $defaults['wps_post_attachments'] = __('Attached'); return $defaults; } function posts_custom_columns_attachment_count($column_name, $id){ if($column_name === 'wps_post_attachments'){ $attachments = get_children(array('post_parent'=>$id)); $count = count($attachments); if($count !=0){echo $count;} } }
Pingback: porn
Pingback: cheapest buy enclomiphene no prescription usa
Pingback: comment obtenir une prescription kamagra
Pingback: order androxal buy mastercard
Pingback: ordering dutasteride ireland over the counter
Pingback: flexeril cyclobenzaprine and overnight
Pingback: order fildena cheap sale
Pingback: how to buy gabapentin price generic
Pingback: Next day fedex shipping for itraconazole
Pingback: how to order avodart generic germany
Pingback: how to get free staxyn samples
Pingback: order rifaximin cheap mastercard
Pingback: kamagra generico online