'[main_product_image_url]', ); public $display_name = 'Main product image url'; public function getValue($post, $field) { return 'product_variation' === $post->post_type ? get_the_post_thumbnail_url($post->post_parent, get_option(Database::$optionPostImageSize, 'medium')) : get_the_post_thumbnail_url($post, get_option(Database::$optionPostImageSize, 'medium')); } }