{"id":405,"date":"2020-04-09T12:24:44","date_gmt":"2020-04-09T12:24:44","guid":{"rendered":"http:\/\/plugins.vjinfotech.com\/wordpress-import-export\/?post_type=ht_kb&#038;p=405"},"modified":"2024-11-21T14:01:10","modified_gmt":"2024-11-21T14:01:10","slug":"export-the-value-returned-by-a-php-function","status":"publish","type":"ht_kb","link":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/documentation\/export-the-value-returned-by-a-php-function\/","title":{"rendered":"Export the value returned by a PHP function"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\" id=\"overview\" >Overview<\/h4>\n\n\n\n<p><strong>WP Import Export<\/strong> <strong>Plugin <\/strong>allows you to integrate Custom PHP Functions across All Export Content Type for Export Fields. This feature gives you powerful control over the data you export.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Export the value returned by a PHP function\" width=\"920\" height=\"518\" src=\"https:\/\/www.youtube.com\/embed\/7B1OIJV6Fwg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<div style=\"height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-by-step-guide-export-the-value-returned-by-a-php-function\" ><strong>Step-by-Step Guide<\/strong>: <strong>Export the value returned by a PHP function<\/strong><\/h4>\n\n\n\n<p><strong>Step 1: Select  Export<\/strong> <strong>Content Type<\/strong>.<\/p>\n\n\n\n<p><strong>Step 2:<\/strong> <strong>Go to the Fields menu Section<\/strong>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In the <strong>Manage Fields<\/strong> section, choose the field name and then click the edit icon.<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 3:<\/strong> <strong>Enter Your PHP Function<\/strong> <strong>Name<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter the name of your custom PHP function in the provided input field and click on Save Button.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"858\" height=\"980\" src=\"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-content\/uploads\/2020\/04\/1-5.png\" alt=\"\" class=\"wp-image-1745\" srcset=\"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-content\/uploads\/2020\/04\/1-5.png 858w, https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-content\/uploads\/2020\/04\/1-5-263x300.png 263w, https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-content\/uploads\/2020\/04\/1-5-768x877.png 768w, https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-content\/uploads\/2020\/04\/1-5-44x50.png 44w, https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-content\/uploads\/2020\/04\/1-5-600x685.png 600w, https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-content\/uploads\/2020\/04\/1-5-320x366.png 320w\" sizes=\"auto, (max-width: 858px) 100vw, 858px\" \/><\/figure>\n\n\n\n<p><strong>Step 4:<\/strong> <strong>Add the Function to Your Active Theme<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to your active theme\u2019s folder and open the <code>functions.php<\/code> file, or any other directly included file in your project.<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 5:<\/strong> <strong>Create a Function that Returns a Valid Value<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Write a function that returns the data in the format you need. Here\u2019s an example that adds a dollar sign ($) to values:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>function add_currency_symbol( $value ) {\n    return \"$ \" . $value;\n}\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht_kb_category":[15],"ht_kb_tag":[],"class_list":["post-405","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-advanced-options"],"_links":{"self":[{"href":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-json\/wp\/v2\/ht_kb\/405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-json\/wp\/v2\/comments?post=405"}],"version-history":[{"count":56,"href":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-json\/wp\/v2\/ht_kb\/405\/revisions"}],"predecessor-version":[{"id":1766,"href":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-json\/wp\/v2\/ht_kb\/405\/revisions\/1766"}],"wp:attachment":[{"href":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-json\/wp\/v2\/media?parent=405"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-json\/wp\/v2\/ht_kb_category?post=405"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/plugins.vjinfotech.com\/wordpress-import-export\/wp-json\/wp\/v2\/ht_kb_tag?post=405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}