{"id":2132,"date":"2019-08-15T14:53:45","date_gmt":"2019-08-15T13:53:45","guid":{"rendered":"https:\/\/ibex.tech\/wordpress-sites\/?p=2132"},"modified":"2022-06-29T12:24:19","modified_gmt":"2022-06-29T11:24:19","slug":"xprofile-fields","status":"publish","type":"post","link":"https:\/\/ibex.tech\/wordpress-sites\/plugins\/buddypress\/xprofile-fields","title":{"rendered":"xprofile Fields"},"content":{"rendered":"\n<p>You can add custom xprofile Fields in Users > Profile Fields (BuddyPress extended profiles must be enabled).  Once created you can the read and write them from code<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Read an xprofile field<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>$MyString = xprofile_get_field_data( 'UserType', bp_loggedin_user_id(), $format = 'array' );<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Write an xprofile field <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>xprofile_set_field_data('UserType', bp_loggedin_user_id(), $MyString);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can add custom xprofile Fields in Users > Profile Fields (BuddyPress extended profiles must be enabled). Once created you can the read and write them from code Read an xprofile field Write an xprofile field<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[175],"tags":[],"class_list":["post-2132","post","type-post","status-publish","format-standard","hentry","category-buddypress"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/2132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/comments?post=2132"}],"version-history":[{"count":4,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/2132\/revisions"}],"predecessor-version":[{"id":4331,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/2132\/revisions\/4331"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/media?parent=2132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/categories?post=2132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/tags?post=2132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}