How to add a custom field to the comments “Quick Edit” screen?

Here’s the function responsible for rendering the comments quick edit form: wp_comment_reply. Looking at its code, it seems you can short-circuit it using the wp_comment_reply filter. That only lets you start from scratch though (e.g. you can’t add to the existing form). The only way around this that I can think of is some (unholy) … Read more

custom field value is blank or empty

You need to pass the $post_id into the get_the_content() : function add_custom_fields($post_id) { global $post; $metadescription = wp_trim_words( get_the_content($post_id), 55 ); add_post_meta($post_id, ‘meta_description’, ” . $metadescription . ”, true); } add_action(‘wp_insert_post’, ‘add_custom_fields’);