{"id":17125379,"date":"2023-10-15T20:38:55","date_gmt":"2023-10-15T20:38:55","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/predefined-fields\/"},"modified":"2023-10-15T20:38:55","modified_gmt":"2023-10-15T20:38:55","slug":"predefined-fields","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/predefined-fields\/","title":{"rendered":"predefined fields"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello ! <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I want to add some fields on the account page, like phone number, address, postal code, city..<br \/><br \/>I have found this snippet : &lt;?php\u00a0\/**\u00a0* Add pre-defined fields to the main Account tab under the &#8220;E-mail Address&#8221; field.\u00a0* Add this code to the file functions.php in the active theme directory.\u00a0*\/function\u00a0um_account_tab_general_fields(\u00a0$args,\u00a0$shortcode_args\u00a0) {\u00a0\/\/ Fields Meta Keys.\u00a0$args\u00a0.=\u00a0&#8216;,birth_date&#8217;;\u00a0$args\u00a0.=\u00a0&#8216;,country&#8217;;\u00a0$args\u00a0.=\u00a0&#8216;,languages&#8217;;\u00a0return\u00a0$args;}add_filter(\u00a0&#8216;um_account_tab_general_fields&#8217;,\u00a0&#8216;um_account_tab_general_fields&#8217;,\u00a010,\u00a02\u00a0);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And it works great for the phone number since it&#8217;s a predefined field on UM. But address, postal code and city are not predefined fields in UM, so I think I have to change some things in the snippet. (Of course, I used the same metas as my registration form)<br \/><br \/>Thank you very much for your help<\/p>\n","protected":false},"template":"","class_list":["post-17125379","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17125379","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\/17125379\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=17125379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}