{"id":10164280,"date":"2018-04-10T08:03:11","date_gmt":"2018-04-10T08:03:11","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/echoing-order-custom-field-in-pdf\/"},"modified":"2018-04-10T08:03:11","modified_gmt":"2018-04-10T08:03:11","slug":"echoing-order-custom-field-in-pdf","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/echoing-order-custom-field-in-pdf\/","title":{"rendered":"Echoing Order custom field in PDF"},"content":{"rendered":"<p>Hi, I&#8217;m using your plugin alongside Woocommerce Admin Custom Order Fields plugin which I used to add a custom field to the order screen. <\/p>\n<p>According to the Woocommerce Admin Custom Order Fields documentation, The meta keys for each admin custom order field are in the format of <code>_wc_acof_{id}<\/code> where {id} is replaced by the integer id of the field. <\/p>\n<p>Once you know the id, you can use <code>get_post_meta( $order_id, &#039;_wc_acof_{id}&#039;, true )<\/code> to get the value of that custom field for a particular order.<\/p>\n<p>So I opened <code>invoice.php<\/code> from your plugin and tried to add that piece of code to the table with class order-data-addresses. <\/p>\n<p>But for some reason, nothing is being echoed. <\/p>\n<p>What would be the way for adding a custom field to the pdf?<\/p>\n","protected":false},"template":"","class_list":["post-10164280","topic","type-topic","status-publish","hentry","topic-tag-custom-field","topic-tag-pdf"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10164280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10164280\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=10164280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}