'[product-description postcontent=true]', ); public $display_name = 'Description (of variation or main)'; public function getValue($post, $field) { if ('product_variation' === $post->post_type) { $postContent = get_post_meta($post->ID, '_variation_description', true); if (empty($postContent) && !empty($post->post_parent)) { $postContent = get_post_field('post_content', $post->post_parent); } } else { $postContent = get_post_field('post_content', $post->ID); } if ( !isset($field['args']['postcontent']) || 'false' !== $field['args']['postcontent'] ) { $postContent = apply_filters('the_content', $postContent); } return wp_strip_all_tags($postContent); } }