{"id":146,"date":"2023-03-01T22:19:33","date_gmt":"2023-03-01T22:19:33","guid":{"rendered":"https:\/\/docs.joedolson.com\/my-calendar-pro\/?p=146"},"modified":"2025-04-20T22:17:54","modified_gmt":"2025-04-20T22:17:54","slug":"custom-fields","status":"publish","type":"post","link":"https:\/\/docs.joedolson.com\/my-calendar-pro\/custom-fields\/","title":{"rendered":"Custom Fields"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">My Calendar supports custom fields to collect event information that isn&#8217;t natively supported by My Calendar. Since My Calendar Pro 3.0.0, you can create your custom fields directly in the admin.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"317\" src=\"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-content\/uploads\/sites\/4\/2023\/03\/image-3.png\" alt=\"Fields to define a new custom field.\" class=\"wp-image-147\" srcset=\"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-content\/uploads\/sites\/4\/2023\/03\/image-3.png 730w, https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-content\/uploads\/sites\/4\/2023\/03\/image-3-300x130.png 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Custom field types supported include <code>text<\/code>, <code>email<\/code>, <code>number<\/code>, <code>date<\/code>, <code>time<\/code>, <code>url<\/code>, <code>tel<\/code>, <code>select<\/code>, <code>checkbox<\/code>, <code>radio<\/code>, <code>textarea<\/code>, and <code>hidden<\/code> fields. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Custom fields can also be defined in <a href=\"https:\/\/github.com\/joedolson\/plugin-extensions\/blob\/master\/my-calendar\/my-calendar-custom-fields.php\">PHP for more advanced configuration<\/a> or defined in a JSON file called <code>mc-custom-fields.json<\/code>, stored in your <code>plugins\/my-calendar-custom<\/code> directory or in your theme directory. An example JSON definition file is in the plugin&#8217;s root folder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All custom fields will be listed in the custom field editor, though PHP and JSON fields can&#8217;t be modified in the editor.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"205\" src=\"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-content\/uploads\/sites\/4\/2023\/03\/image-4.png\" alt=\"View of an editable field demo.\" class=\"wp-image-148\" srcset=\"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-content\/uploads\/sites\/4\/2023\/03\/image-4.png 732w, https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-content\/uploads\/sites\/4\/2023\/03\/image-4-300x84.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"260\" src=\"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-content\/uploads\/sites\/4\/2023\/03\/image-5.png\" alt=\"View of the field with editable fields.\" class=\"wp-image-149\" srcset=\"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-content\/uploads\/sites\/4\/2023\/03\/image-5.png 725w, https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-content\/uploads\/sites\/4\/2023\/03\/image-5-300x108.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Sample JSON Custom Field Definition<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n\t\"unique_field_key\":\n\t{\n\t\t\"field_label\": \"Label\",\n\t\t\"field_type\": \"text\",\n\t\t\"field_notes\": \"Example notes\",\n\t\t\"field_required\": \"true\",\n\t\t\"id\": \"_label\",\n\t\t\"sanitize_callback\": \"sanitize_text_field\",\n\t\t\"escape_callback\": \"esc_attr\",\n\t\t\"display_callback\": \"wp_kses_post\"\n\t}\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>My Calendar supports custom fields to collect event information that isn&#8217;t natively supported by My Calendar. Since My Calendar Pro 3.0.0, you can create your custom fields directly in the admin. Custom field types supported include text, email, number, date, time, url, tel, select, checkbox, radio, textarea, and hidden fields. Custom fields can also be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,16],"tags":[],"class_list":["post-146","post","type-post","status-publish","format-standard","hentry","category-admin","category-custom-fields"],"_links":{"self":[{"href":"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-json\/wp\/v2\/posts\/146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-json\/wp\/v2\/comments?post=146"}],"version-history":[{"count":3,"href":"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-json\/wp\/v2\/posts\/146\/revisions"}],"predecessor-version":[{"id":150,"href":"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-json\/wp\/v2\/posts\/146\/revisions\/150"}],"wp:attachment":[{"href":"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-json\/wp\/v2\/media?parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-json\/wp\/v2\/categories?post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar-pro\/wp-json\/wp\/v2\/tags?post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}