1"use strict";(globalThis.webpackChunkbuilderius=globalThis.webpackChunkbuilderius||[]).push([[7252],{7227:(e,n,a)=>{a.d(n,{A:()=>i});a(6540);var s=a(8215);const l={tabItem:"tabItem_Ymn6"};var r=a(4848);function i({children:e,hidden:n,className:a}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.A)(l.tabItem,a),hidden:n,children:e})}},7302:(e,n,a)=>{a.r(n),a.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>p,frontMatter:()=>c,metadata:()=>s,toc:()=>u});const s=JSON.parse('{"id":"dynamic-data/query-examples/acf","title":"ACF in Custom Queries","description":"ACF fields work automatically in Builderius without writing any GraphQL code. Fields appear in the Dynamic Data dropdown and can be added to any element with a click. Learn about built-in ACF integration \u2192","source":"@site/docs/dynamic-data/query-examples/acf.md","sourceDirName":"dynamic-data/query-examples","slug":"/dynamic-data/query-examples/acf","permalink":"/docs/dynamic-data/query-examples/acf","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"id":"acf","title":"ACF in Custom Queries"},"sidebar":"docs","previous":{"title":"Website Queries","permalink":"/docs/dynamic-data/query-examples/website"},"next":{"title":"Meta Box in Custom Queries","permalink":"/docs/dynamic-data/query-examples/metabox"}}');var l=a(4848),r=a(8453),i=a(9489),t=a(7227);const c={id:"acf",title:"ACF in Custom Queries"},o=void 0,d={},u=[{value:"When to Use Custom ACF GraphQL Queries",id:"when-to-use-custom-acf-graphql-queries",level:2},{value:"ACF Field Access Methods",id:"acf-field-access-methods",level:2},{value:"Simple vs Other Methods",id:"simple-vs-other-methods",level:3},{value:"Post Object Example",id:"post-object-example",level:3},{value:"Simple Method",id:"simple-method",level:4},{value:"Advanced Method",id:"advanced-method",level:4},{value:"Querying ACF Fields",id:"querying-acf-fields",level:2},{value:"Filtering with ACF Fields",id:"filtering-with-acf-fields",level:2},{value:"Meta Query Syntax Reference",id:"meta-query-syntax-reference",level:3},{value:"Queries With ACF Filtering",id:"queries-with-acf-filtering",level:3},{value:"Query ACF Based on Different Contexts",id:"query-acf-based-on-different-contexts",level:2},{value:"Key Context Rules",id:"key-context-rules",level:3},{value:"Advanced Field Metadata Access",id:"advanced-field-metadata-access",level:2},{value:"ACF Field Configuration",id:"acf-field-configuration",level:3},{value:"Here is an example of the <code>acf_field_object()</code> for acf image field",id:"here-is-an-example-of-the-acf_field_object-for-acf-image-field",level:4},{value:"Field Object vs Field Value Summary",id:"field-object-vs-field-value-summary",level:3}];function h(e){const n={a:"a",admonition:"admonition",br:"br",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:a}=n;return a||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(n.admonition,{title:"GraphQL is Not Required for ACF Usage",type:"info",children:[(0,l.jsxs)(n.p,{children:["ACF fields work automatically in Builderius without writing any GraphQL code. Fields appear in the Dynamic Data dropdown and can be added to any element with a click. ",(0,l.jsx)(n.strong,{children:(0,l.jsx)(n.a,{href:"../data-fields/acf",children:"Learn about built-in ACF integration \u2192"})})]}),(0,l.jsxs)(n.p,{children:["This article provides guidelines for when you need to use ACF within your custom queries ",(0,l.jsx)("span",{class:"badge pro",children:"Pro Feature"}),", or when you need specific control not aviailble out of the box."]})]}),"\n",(0,l.jsx)(n.h2,{id:"when-to-use-custom-acf-graphql-queries",children:"When to Use Custom ACF GraphQL Queries"}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Built-in ACF integration covers many use cases."})," Use custom GraphQL queries when you need:"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Filtering"})," - Use ACF fields in query arguments"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Complex relationships"})," - Complex ACF connections"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Custom formatting"})," - Transform field values with expressions"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Performance control"})," - Optimize expensive queries to get only the data you need"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Cross-context access"})," - ACF fields from different post types together"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"acf-field-access-methods",children:"ACF Field Access Methods"}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsxs)(n.strong,{children:["Understanding the difference between ",(0,l.jsx)(n.code,{children:"acf_value(
1)"})," and other ACF methods:"]})}),"\n",(0,l.jsx)(n.p,{children:"Builderius provides two approaches for accessing ACF fields - simple value retrieval and advanced object access. The choice depends on your needs when it comes to what data you need and how much control you need."}),"\n",(0,l.jsx)(n.h3,{id:"simple-vs-other-methods",children:"Simple vs Other Methods"}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Simple Method"})," (",(0,l.jsx)(n.code,{children:"acf_value"}),"):\nReturns whatever format the ACF field is configured to return (with some exceptions) - could be just an ID, URL, or basic object depending on field settings. It is simple to use, but offers less control over what you can retrieve and how."]}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Advanced Methods"})," (",(0,l.jsx)(n.code,{children:"acf_post_object_value"}),", ",(0,l.jsx)(n.code,{children:"acf_user_value"}),", etc.) ",(0,l.jsx)("span",{class:"badge pro",children:"Pro Feature"}),":\nThese methods require a couple more steps but they come with a lot of benefits. You get way more control. You can pick and choose what data you can retrieve and how. You get \u2014 complete control."]}),"\n",(0,l.jsx)(n.h3,{id:"post-object-example",children:"Post Object Example"}),"\n",(0,l.jsx)(n.h4,{id:"simple-method",children:"Simple Method"}),"\n",(0,l.jsxs)(i.A,{groupId:"simple-method",defaultValue:"simple-graphql",values:[{label:"GraphQL",value:"simple-graphql"},{label:"JSON",value:"simple-json"}],children:[(0,l.jsxs)(t.A,{value:"simple-graphql",children:[(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"GraphQL with"})," ",(0,l.jsx)(n.code,{children:"acf_value()"}),":"]}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n post {\n # Returns whatever the ACF field return format is set to\n featured_article: acf_value(name: "featured_article")\n }\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"simple-json",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"JSON Output (depends on ACF field settings):"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "featured_article": {\n "ID": 123,\n "post_author": "5",\n "post_date": "2024-11-21 10:30:00",\n "post_date_gmt": "2024-11-21 10:30:00",\n "post_content": "\x3c!-- wp:paragraph --\x3e<p>Full article content here...</p>\x3c!-- /wp:paragraph --\x3e",\n "post_title": "How to Build Better Websites",\n "post_excerpt": "Learn the fundamentals...",\n "post_status": "publish",\n "comment_status": "open",\n "ping_status": "open",\n "post_password": "",\n "post_name": "how-to-build-better-websites",\n "post_modified": "2024-11-21 15:45:00",\n "post_modified_gmt": "2024-11-21 15:45:00",\n "post_parent": 0,\n "guid": "https://site.com/?p=123",\n "menu_order": 0,\n "post_type": "post",\n "post_mime_type": "",\n "comment_count": "12"\n }\n}\n'})})]})]}),"\n",(0,l.jsx)(n.h4,{id:"advanced-method",children:"Advanced Method"}),"\n",(0,l.jsxs)(i.A,{groupId:"advanced-method",defaultValue:"advanced-graphql",values:[{label:"GraphQL",value:"advanced-graphql"},{label:"JSON",value:"advanced-json"}],children:[(0,l.jsxs)(t.A,{value:"advanced-graphql",children:[(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"GraphQL with"})," ",(0,l.jsx)(n.code,{children:"acf_post_object_value()"}),":"]}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n post {\n # Select only the fields you need\n featured_article: acf_post_object_value(name: "featured_article") {\n post_title\n permalink\n featured_image {\n file_url\n alt_text\n }\n # Access ACF fields on the related post\n reading_time: acf_value(name: "reading_time")\n }\n }\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"advanced-json",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"JSON Output (have their own subfields, from core or from ACF):"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "featured_article": {\n "post_title": "How to Build Better Websites",\n "permalink": "https://site.com/how-to-build-better-websites/",\n "featured_image": {\n "file_url": "https://site.com/wp-content/uploads/hero.jpg",\n "alt_text": "Website screenshot"\n },\n "reading_time": "8 minutes"\n }\n}\n'})})]})]}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"The key difference:"})," The ",(0,l.jsx)(n.code,{children:"acf_post_object_value"})," requires you to define at least one ",(0,l.jsx)(n.strong,{children:"subfield"}),". In the case of Post Object field, these can be any field attatched to a post object; native ones like post_title, post_excerpt etc. or other acf fields tieh a location set to post."]}),"\n",(0,l.jsx)(n.p,{children:"With out autocomplete it's easy to add these fields, and the benefits are important. The advanced method gives you control over which data you retrieve, making queries more efficient by requesting only what you need, rather than getting the entire object dump."}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"How do you later access these subfields?"})," Use the Dynamic Data dropdown, click the post object field that appears, and select the subfield when the object expands in the dropdown. A ",(0,l.jsx)(n.code,{children:"[[custom.post.featured_article.post_title]]"})," will be added to your element and it will render in the canvas."]}),"\n",(0,l.jsx)(n.h2,{id:"querying-acf-fields",children:"Querying ACF Fields"}),"\n",(0,l.jsxs)(i.A,{groupId:"acf-methods",defaultValue:"simple-fields",values:[{label:"Simple Values",value:"simple-fields"},{label:"Object Relationships",value:"object-fields"},{label:"Array Data",value:"array-fields"}],children:[(0,l.jsxs)(t.A,{value:"simple-fields",children:[(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:'acf_value(name: "field_name")'})," - Returns the field value"]}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Applies to all basic field types:"})}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"Text, Textarea, Number, Email, URL, Password"}),"\n",(0,l.jsx)(n.li,{children:"Select, Radio, Checkbox, Button Group"}),"\n",(0,l.jsx)(n.li,{children:"True/False (boolean)"}),"\n",(0,l.jsx)(n.li,{children:"Date Picker, Time Picker, Date Time Picker"}),"\n",(0,l.jsx)(n.li,{children:"Color Picker, Range, WYSIWYG Editor"}),"\n",(0,l.jsx)(n.li,{children:"Image/File fields (when return format = URL or ID)"}),"\n",(0,l.jsx)(n.li,{children:"Single selections from relationship fields"}),"\n"]}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n post {\n # Text and content fields\n subtitle: acf_value(name: "subtitle")\n price: acf_value(name: "price") \n featured: acf_value(name: "featured")\n event_date: acf_value(name: "event_date")\n brand_color: acf_value(name: "brand_color")\n \n # Image field (URL format)\n hero_image_url: acf_value(name: "hero_image")\n \n # Transform values\n formatted_price: expression_result(\n expression: "\'$\' . price"\n )\n \n formatted_date: expression_result(\n expression: "date(\'F j, Y\', strtotime(event_date))"\n )\n }\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"object-fields",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Object fields return single structured data with named properties:"})}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_group_value(name: "field_name")'})," - Group fields (organized related data)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_post_object_value(name: "field_name")'})," - Single post relationship"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_user_value(name: "field_name")'})," - Single user relationship"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_taxonomy_value(name: "field_name")'})," - Single term relationship"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Image fields"}
1)," - Use ",(0,l.jsx)(n.code,{children:"acf_value()"})," when return format = Array (single image object)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"File fields"})," - Use ",(0,l.jsx)(n.code,{children:"acf_value()"})," when return format = Array (single file object)"]}),"\n"]}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n post {\n # Group field - organized related data\n contact_info: acf_group_value(name: "contact_details") {\n phone: acf_value(name: "phone")\n email: acf_value(name: "email")\n address: acf_value(name: "address")\n }\n \n # Single post relationship \n featured_article: acf_post_object_value(name: "featured_article") {\n post_title\n permalink\n # Access ACF fields on related post\n article_type: acf_value(name: "article_type")\n reading_time: acf_value(name: "reading_time")\n }\n \n # Single user relationship\n author: acf_user_value(name: "guest_author") {\n display_name\n user_email\n # User ACF fields\n job_title: acf_value(name: "position")\n bio: acf_value(name: "bio_extended")\n }\n \n # Single taxonomy relationship\n primary_category: acf_taxonomy_value(name: "main_category") {\n name\n slug\n # Term ACF fields\n category_color: acf_value(name: "color")\n icon: acf_value(name: "category_icon")\n }\n \n # Image field (Array format) - single image object\n hero_image: acf_value(name: "hero_image")\n \n # File field (Array format) - single file object \n brochure: acf_value(name: "product_brochure")\n \n # Access object properties\n hero_url: expression_result(\n expression: "hero_image.url"\n )\n \n contact_email: expression_result(\n expression: "contact_info.email"\n )\n }\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"array-fields",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Array fields return multiple values or collections:"})}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_repeater_value(name: "field_name")'})," - Repeater fields (array of row objects)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_relationship_value(name: "field_name")'})," - Relationship fields (array of post objects)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_post_objects_value(name: "field_name")'})," - Post Object fields set to multiple (array of post objects)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_users_value(name: "field_name")'})," - User fields set to multiple (array of user objects)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_taxonomies_value(name: "field_name")'})," - Taxonomy fields set to multiple (array of term objects)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Gallery fields"})," - Use ",(0,l.jsx)(n.code,{children:"acf_value()"})," (array of image objects)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Select fields (multiple)"})," - Use ",(0,l.jsx)(n.code,{children:"acf_value()"})," (array of selected values)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Checkbox fields"})," - Use ",(0,l.jsx)(n.code,{children:"acf_value()"})," (array of checked values)"]}),"\n"]}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n post {\n # Repeater field - multiple instances\n team_members: acf_repeater_value(name: "team") {\n name: acf_value(name: "member_name")\n role: acf_value(name: "position")\n photo: acf_value(name: "headshot")\n \n # Calculate within repeater\n display_name: expression_result(\n expression: "name . \' - \' . role"\n )\n }\n \n # Relationship field (multiple posts)\n related_articles: acf_relationship_value(name: "related_content") {\n post_title\n permalink\n excerpt: acf_value(name: "custom_excerpt")\n }\n \n # Multiple post objects\n recommended_products: acf_post_objects_value(name: "products") {\n post_title\n price: acf_value(name: "price")\n in_stock: acf_value(name: "available")\n }\n \n # Multiple taxonomy terms\n skill_areas: acf_taxonomies_value(name: "expertise") {\n name\n slug\n proficiency: acf_value(name: "skill_level")\n }\n \n # Gallery field (array of images)\n gallery: acf_value(name: "project_gallery")\n \n # Multiple select field (array of selected options)\n features: acf_value(name: "product_features")\n \n # Checkbox field (array of checked values)\n amenities: acf_value(name: "available_amenities")\n \n # Process arrays\n gallery_count: expression_result(\n expression: "count(gallery)"\n )\n \n first_image: expression_result(\n expression: "gallery[0].url"\n )\n \n features_list: expression_result(\n expression: "join(features, \', \')"\n )\n \n total_skills: expression_result(\n expression: "count(skill_areas)"\n )\n \n team_size: expression_result(\n expression: "count(team_members)"\n )\n }\n}\n'})})]})]}),"\n",(0,l.jsx)(n.h2,{id:"filtering-with-acf-fields",children:"Filtering with ACF Fields"}),"\n",(0,l.jsx)(n.p,{children:"Use ACF fields in query arguments to filter posts, users, and terms based on custom field values."}),"\n",(0,l.jsx)(n.h3,{id:"meta-query-syntax-reference",children:"Meta Query Syntax Reference"}),"\n",(0,l.jsxs)(i.A,{groupId:"syntax-reference",defaultValue:"single-condition",values:[{label:"Single Condition",value:"single-condition"},{label:"Multiple Conditions",value:"multiple-conditions-syntax"},{label:"Data Types",value:"data-types"},{label:"Comparison Operators",value:"operators"}],children:[(0,l.jsxs)(t.A,{value:"single-condition",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Basic single condition syntax:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'meta_query: {\n array: [\n {\n key: "field_name"\n value: "field_value"\n compare: "="\n }\n ]\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Examples:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'# Text field\n{\n key: "status"\n value: "published"\n compare: "="\n}\n\n# Number field\n{\n key: "rating"\n value: 5\n compare: "="\n type: "NUMERIC"\n}\n\n# Boolean field\n{\n key: "featured"\n value: true\n compare: "="\n type: "BOOLEAN"\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"multiple-conditions-syntax",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Combining conditions with AND/OR:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'meta_query: {\n relation: "AND" # or "OR"\n array: [\n {\n key: "field1"\n value: "value1"\n compare: "="\n }\n {\n key: "field2" \n value: "value2"\n compare: "="\n }\n ]\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Nested conditions:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'meta_query: {\n relation: "AND"\n array: [\n {\n key: "status"\n value: "active"\n compare: "="\n }\n {\n relation: "OR"\n array: [\n {\n key: "priority"\n value: "high"\n compare: "="\n }\n {\n key: "urgent"\n value: true\n compare: "="\n type: "BOOLEAN"\n }\n ]\n }\n ]\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"data-types",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Data type specifications:"})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Text fields (default):"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n key: "category"\n value: "tutorial"\n compare: "="\n # No type needed - default is text\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Numeric fields:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n key: "price"\n value: 100\n compare: ">"\n type: "NUMERIC"\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Date fields:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n key: "event_date"\n value: "2024-12-01"\n compare: ">="\n type: "DATE"\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Boolean fields:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n key: "featured"\n value: true\n compare: "="\n type: "BOOLEAN"\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Decimal fields:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n key: "rating"\n value: 4.5\n compare: ">="\n type: "DECIMAL"\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"operators",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Comparison operators:"})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Equality:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'compare: "=" # Equals\ncompare: "!=" # Not equals\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Numeric comparisons:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'compare: ">" # Greater than\ncompare: ">=" # Greater than or equal\ncompare: "<" # Less than\ncompare: "<=" # Less than or equal\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Range comparisons:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n key: "price"\n value: [50, 200]\n compare: "BETWEEN"\n type: "NUMERIC"\n}\n\n{\n key: "price"\n value: [50, 200]\n compare: "NOT BETWEEN"\n type: "NUMERIC"\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Text matching:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'compare: "LIKE" # Contains text\ncompare: "NOT LIKE" # Does not contain text\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Multiple values:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n key: "status"\n value: ["active", "pending"]\n compare: "IN"\n}\n\n{\n key: "status"\n value: ["inactive", "deleted"]\n compare: "NOT IN"\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Field existence:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'compare: "EXISTS" # Field has any value\
1ncompare: "NOT EXISTS" # Field is empty or missing\n'})})]})]}),"\n",(0,l.jsx)(n.p,{children:"Use ACF filtering to find posts with specific field values, creating dynamic content based on custom field criteria."}),"\n",(0,l.jsx)(n.h3,{id:"queries-with-acf-filtering",children:"Queries With ACF Filtering"}),"\n",(0,l.jsxs)(i.A,{groupId:"acf-filtering",defaultValue:"basic-filtering",values:[{label:"Basic Filtering",value:"basic-filtering"},{label:"Multiple Conditions",value:"multiple-conditions"},{label:"Common Patterns",value:"common-patterns"}],children:[(0,l.jsxs)(t.A,{value:"basic-filtering",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Simple field value filtering:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n # Featured articles\n featured_articles: posts_query(\n arguments: {\n post_type: "article"\n meta_query: {\n array: [\n {\n key: "featured"\n value: true\n compare: "="\n type: "BOOLEAN"\n }\n ]\n }\n }\n ) {\n posts {\n post_title\n featured: acf_value(name: "featured")\n }\n }\n'})})]}),(0,l.jsxs)(t.A,{value:"multiple-conditions",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Combining multiple field conditions:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n # Articles that are both featured AND published\n featured_published: posts_query(\n arguments: {\n post_type: "article"\n meta_query: {\n relation: "AND"\n array: [\n {\n key: "featured"\n value: true\n compare: "="\n type: "BOOLEAN"\n }\n {\n key: "article_status"\n value: "published"\n compare: "="\n }\n ]\n }\n }\n ) {\n posts {\n post_title\n featured: acf_value(name: "featured")\n status: acf_value(name: "article_status")\n }\n }\n'})})]}),(0,l.jsxs)(t.A,{value:"common-patterns",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Common filtering patterns:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n # Posts missing required fields (quality check)\n incomplete_articles: posts_query(\n arguments: {\n post_type: "article"\n meta_query: {\n array: [\n {\n key: "author_bio"\n compare: "NOT EXISTS"\n }\n ]\n }\n }\n ) {\n posts {\n post_title\n has_bio: expression_result(\n expression: "acf_value(\'author_bio\') ? \'Yes\' : \'No\'"\n )\n }\n }\n'})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'# Order by ACF field value\nevents_by_date: posts_query(\n arguments: {\n post_type: "event"\n orderby: "meta_value"\n meta_key: "event_date"\n order: "ASC"\n }\n) {\n posts {\n post_title\n event_date: acf_value(name: "event_date")\n }\n}\n'})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'# Filter by relationship field\nposts_by_author: posts_query(\n arguments: {\n post_type: "article"\n meta_query: {\n array: [\n {\n key: "guest_author"\n value: 123\n compare: "="\n type: "NUMERIC"\n }\n ]\n }\n }\n) {\n posts {\n post_title\n author: acf_user_value(name: "guest_author") {\n display_name\n }\n }\n}\n}\n'})})]})]}),"\n",(0,l.jsx)(n.h2,{id:"query-acf-based-on-different-contexts",children:"Query ACF Based on Different Contexts"}),"\n",(0,l.jsxs)(i.A,{groupId:"acf-contexts",defaultValue:"post-context",values:[{label:"Post Context",value:"post-context"},{label:"Term Context",value:"term-context"},{label:"User Context",value:"user-context"},{label:"Navigation Context",value:"nav-context"},{label:"Options Context",value:"options-context"}],children:[(0,l.jsxs)(t.A,{value:"post-context",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Current Post:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n post {\n post_title\n subtitle: acf_value(name: "subtitle")\n event_date: acf_value(name: "event_date")\n featured: acf_value(name: "featured")\n }\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Specific Post:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n about_page: post(identifier: "slug", value: "about") {\n post_title\n company_name: acf_value(name: "company_name")\n founding_year: acf_value(name: "founded")\n }\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Posts Loop:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n articles: posts_query(\n arguments: {\n post_type: "article"\n posts_per_page: 5\n }\n ) {\n posts {\n post_title\n reading_time: acf_value(name: "reading_time")\n author_bio: acf_value(name: "author_bio")\n }\n }\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"term-context",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Current Term (Archive Context):"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n archive {\n term {\n name\n description\n category_color: acf_value(name: "brand_color")\n category_icon: acf_value(name: "icon")\n }\n }\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Specific Term:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n marketing_category: term(\n identifier: "slug"\n value: "marketing"\n taxonomy: "category"\n ) {\n name\n description\n header_image: acf_value(name: "category_header")\n featured_on_homepage: acf_value(name: "featured")\n }\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Terms Loop:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n categories: terms_query(\n arguments: {\n taxonomy: "category"\n hide_empty: true\n }\n ) {\n terms {\n name\n slug\n category_color: acf_value(name: "brand_color")\n commission_rate: acf_value(name: "commission_rate")\n }\n }\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"user-context",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Current User:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n current_user {\n display_name\n user_email\n job_title: acf_value(name: "position")\n bio: acf_value(name: "bio_extended")\n }\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Specific User:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n author_profile: user(identifier: "ID", value: 5) {\
1n display_name\n author_bio: acf_value(name: "author_bio")\n website: acf_value(name: "personal_website")\n }\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Users Loop:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n team_members: users_query(\n arguments: {\n role: "author"\n number: 10\n }\n ) {\n users {\n display_name\n department: acf_value(name: "department")\n hire_date: acf_value(name: "start_date")\n }\n }\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"nav-context",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Navigation Menu Items:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n nav_menu(identifier: "slug", value: "main-menu") {\n items {\n title\n url\n menu_icon: acf_value(name: "menu_icon")\n highlight_item: acf_value(name: "featured_menu_item")\n \n children @recursive {\n title\n url\n menu_icon: acf_value(name: "menu_icon")\n }\n }\n }\n}\n'})})]}),(0,l.jsxs)(t.A,{value:"options-context",children:[(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Global Options (No Context Wrapper):"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n # Direct access at root level\n site_logo: acf_value(name: "company_logo")\n contact_email: acf_value(name: "main_contact_email")\n \n # Group field\n site_branding: acf_group_value(name: "brand_settings") {\n primary_color: acf_value(name: "primary_color")\n logo_dark: acf_value(name: "logo_dark_mode")\n }\n \n # Repeater field\n social_links: acf_repeater_value(name: "social_media") {\n platform: acf_value(name: "platform_name")\n url: acf_value(name: "profile_url")\n }\n}\n'})})]})]}),"\n",(0,l.jsx)(n.h3,{id:"key-context-rules",children:"Key Context Rules"}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Posts:"})," ACF fields accessed within ",(0,l.jsx)(n.code,{children:"post { ... }"})," or ",(0,l.jsx)(n.code,{children:"posts { ... }"}),(0,l.jsx)(n.br,{}),"\n",(0,l.jsx)(n.strong,{children:"Terms:"})," ACF fields accessed within ",(0,l.jsx)(n.code,{children:"term { ... }"})," or ",(0,l.jsx)(n.code,{children:"terms { ... }"}),(0,l.jsx)(n.br,{}),"\n",(0,l.jsx)(n.strong,{children:"Users:"})," ACF fields accessed within ",(0,l.jsx)(n.code,{children:"current_user { ... }"})," or ",(0,l.jsx)(n.code,{children:"users { ... }"}),(0,l.jsx)(n.br,{}),"\n",(0,l.jsx)(n.strong,{children:"Navigation:"})," ACF fields accessed within menu ",(0,l.jsx)(n.code,{children:"items { ... }"}),(0,l.jsx)(n.br,{}),"\n",(0,l.jsx)(n.strong,{children:"Options:"})," ACF fields accessed directly at root level (no wrapper needed)"]}),"\n",(0,l.jsx)(n.h2,{id:"advanced-field-metadata-access",children:"Advanced Field Metadata Access"}),"\n",(0,l.jsx)(n.h3,{id:"acf-field-configuration",children:"ACF Field Configuration"}),"\n",(0,l.jsxs)(n.p,{children:["Beyond accessing field values, you can also query the field configuration and metadata using ",(0,l.jsx)(n.code,{children:"acf_field_object()"}),". This returns information about how the field is set up rather than the data it contains."]}),"\n",(0,l.jsxs)(n.h4,{id:"here-is-an-example-of-the-acf_field_object-for-acf-image-field",children:["Here is an example of the ",(0,l.jsx)(n.code,{children:"acf_field_object()"})," for acf image field"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'"acf_field_object": {\n "ID": 148,\n "key": "field_692155ef32f1e",\n "label": "img",\n "name": "img",\n "aria-label": "",\n "prefix": "acf",\n "type": "image",\n "value": null,\n "menu_order": 2,\n "instructions": "",\n "required": 0,\n "id": "",\n "class": "",\n "conditional_logic": 0,\n "parent": 131,\n "wrapper": {\n "width": "",\n "class": "",\n "id": ""\n },\n "return_format": "array",\n "library": "all",\n "min_width": "",\n "min_height": "",\n "min_size": "",\n "max_width": "",\n "max_height": "",\n "max_size": "",\n "mime_types": "",\n "allow_in_bindings": 0,\n "preview_size": "medium",\n "_name": "img",\n "_valid": 1\n }\n'})}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"When to use"})," ",(0,l.jsx)(n.code,{children:"acf_field_object()"}),":"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"Build dynamic interfaces that adapt based on field configuration"}),"\n",(0,l.jsx)(n.li,{children:"Create conditional content based on field types and settings"}),"\n",(0,l.jsx)(n.li,{children:"Access field choices for select/radio/checkbox fields"}),"\n",(0,l.jsx)(n.li,{children:"Validate data against field constraints"}),"\n",(0,l.jsx)(n.li,{children:"Display field labels and instructions dynamically"}),"\n"]}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"The key difference:"}
1)," ",(0,l.jsx)(n.code,{children:"acf_value()"})," gives you the data, ",(0,l.jsx)(n.code,{children:"acf_field_object()"})," gives you the schema."]}),"\n",(0,l.jsxs)(a,{children:[(0,l.jsx)("summary",{children:(0,l.jsx)("strong",{children:"Get Field Choices and Options"})}),(0,l.jsx)(n.p,{children:"Access the available choices for select, radio, and checkbox fields:"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n color_field_config: acf_field_object(name: "product_color")\n size_field_config: acf_field_object(name: "product_size")\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Returns field configuration with choices:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "color_field_config": {\n "type": "select",\n "label": "Product Color",\n "choices": {\n "red": "Red",\n "blue": "Blue", \n "green": "Green"\n }\n }\n}\n'})}),(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Use case:"})," Build dynamic dropdowns, display all available options, or show human-readable labels for selected values."]})]}),"\n",(0,l.jsxs)(a,{children:[(0,l.jsx)("summary",{children:(0,l.jsx)("strong",{children:"Field Labels and Instructions"})}),(0,l.jsx)(n.p,{children:"Get field metadata for display purposes:"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n image_field_info: acf_field_object(name: "hero_image")\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Returns field configuration:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "image_field_info": {\n "type": "image",\n "label": "Hero Image",\n "instructions": "Upload a high-resolution image for the hero section",\n "required": 1\n }\n}\n'})}),(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Use case:"})," Show field labels in forms, display help text, or add required field indicators."]})]}),"\n",(0,l.jsxs)(a,{children:[(0,l.jsx)("summary",{children:(0,l.jsx)("strong",{children:"Conditional Content Based on Field Types"})}),(0,l.jsx)(n.p,{children:"Use field type information for conditional display in Builderius conditions tool:"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n dynamic_field_config: acf_field_object(name: "content_block")\n dynamic_field_value: acf_value(name: "content_block")\n}\n'})}),(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Use case:"})," In Builderius conditions, check if ",(0,l.jsx)(n.code,{children:"dynamic_field_config.type"}),' equals "image" to show image components, "wysiwyg" to show rich text, or "select" to display choice-based content. This allows one template to handle multiple field types dynamically.']})]}),"\n",(0,l.jsxs)(a,{children:[(0,l.jsx)("summary",{children:(0,l.jsx)("strong",{children:"Validation Rules and Constraints"})}),(0,l.jsx)(n.p,{children:"Access field constraints for validation or display logic:"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n upload_constraints: acf_field_object(name: "profile_photo")\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Returns validation rules:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "upload_constraints": {\n "type": "image",\n "required": 1,\n "min_
1width": "300",\n "max_width": "1200", \n "mime_types": "jpg,jpeg,png",\n "return_format": "array"\n }\n}\n'})}),(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Use case:"})," Display upload requirements to users, validate file dimensions, or determine how to process the field value based on return_format."]})]}),"\n",(0,l.jsxs)(a,{children:[(0,l.jsx)("summary",{children:(0,l.jsx)("strong",{children:"Dynamic Form Building"})}),(0,l.jsx)(n.p,{children:"Query multiple field configurations to build forms dynamically:"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n contact_form_fields: {\n name_field: acf_field_object(name: "contact_name")\n email_field: acf_field_object(name: "contact_email") \n country_field: acf_field_object(name: "contact_country")\n message_field: acf_field_object(name: "contact_message")\n }\n}\n'})}),(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Use case:"})," Build contact forms or user input interfaces that adapt based on field configurations, showing appropriate input types and validation rules for each field."]})]}),"\n",(0,l.jsxs)(a,{children:[(0,l.jsx)("summary",{children:(0,l.jsx)("strong",{children:"Layout and Styling Configuration"})}),(0,l.jsx)(n.p,{children:"Access wrapper attributes set in ACF field configuration (available on any field type):"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n # Any field type can have wrapper settings\n name_field_config: acf_field_object(name: "contact_name")\n image_field_config: acf_field_object(name: "hero_image")\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Returns wrapper configuration from ACF admin settings:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "name_field_config": {\n "type": "text",\n "wrapper": {\n "width": "50",\n "class": "required-field",\n "id": "contact-name"\n }\n }\n}\n'})}),(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Use case:"})," Apply the same CSS classes, widths, and IDs that were configured in the ACF admin to your frontend elements for consistent styling."]})]}),"\n",(0,l.jsxs)(a,{children:[(0,l.jsx)("summary",{children:(0,l.jsx)("strong",{children:"Conditional Logic Rules"})}),(0,l.jsx)(n.p,{children:"Access ACF conditional logic to replicate admin behavior on frontend:"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-graphql",children:'{\n membership_value: acf_value(name: "membership_type")\n company_field_config: acf_field_object(name: "company_size")\n premium_field_config: acf_field_object(name: "premium_features")\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Returns conditional logic rules:"})}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "membership_value": "premium",\n "company_field_config": {\n "conditional_logic": [\n [\n {\n "field": "membership_type",\n "operator": "==",\n "value": "enterprise"\n }\n ]\n ]\n },\n "premium_field_config": {\n "conditional_logic": [\n [\n {\n "field": "membership_type", \n "operator": "==",\n "value": "premium"\n }\n ]\n ]\n }\n}\n'})}),(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Practical use case:"})}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["In Builderius conditions, show company size field only when ",(0,l.jsx)(n.code,{children:"[[custom.membership_value]]"}),' equals "enterprise"']}),"\n",(0,l.jsxs)(n.li,{children:["Display premium features section when ",(0,l.jsx)(n.code,{children:"[[custom.membership_value]]"}),' equals "premium"']}),"\n",(0,l.jsx)(n.li,{children:"Build dynamic forms where field visibility matches exactly what users see in WordPress admin"}),"\n",(0,l.jsx)(n.li,{children:"Create conditional content blocks that appear/disappear based on user selections, keeping frontend behavior synchronized with backend field logic"}),"\n"]})]}),"\n",(0,l.jsx)(n.h3,{id:"field-object-vs-field-value-summary",children:"Field Object vs Field Value Summary"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_value(name: "field_name")'})," \u2192 The actual data (what users entered)"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:'acf_field_object(name: "field_name")'})," \u2192 The configuration (how the field is set up)"]}),"\n"]}),"\n",(0,l.jsxs)(n.p,{children:["Use ",(0,l.jsx)(n.code,{children:"acf_field_object()"})," when building flexible, dynamic interfaces that need to adapt based on field configuration rather than field values."]})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(h,{...e})}):h(e)}},8453:(e,n,a)=>{a.d(n,{R:()=>i,x:()=>t});var s=a(6540);const l={},r=s.createContext(l);function i(e){const n=s.useContext(r);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:i(e.components),s.createElement(r.Provider,{value:n},e.children)}},9489:(e,n,a)=>{a.d(n,{A:()=>w});var s=a(6540),l=a(8215),r=a(8630),i=a(4245),t=a(6347),c=a(6494),o=a(2814),d=a(5167),u=a(9900);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs>
1 child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:a}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:a,default:s}})=>({value:e,label:n,attributes:a,default:s}))}(a);return function(e){const n=(0,d.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e},[n,a])}function m({value:e,tabValues:n}){return n.some(n=>n.value===e)}function f({queryString:e=!1,groupId:n}){const a=(0,t.W6)(),l=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,o.aZ)(l),(0,s.useCallback)(e=>{if(!l)return;const n=new URLSearchParams(a.location.search);n.set(l,e),a.replace({...a.location,search:n.toString()})},[l,a])]}function x(e){const{defaultValue:n,queryString:a=!1,groupId:l}=e,r=p(e),[i,t]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!m({value:e,tabValues:n}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const a=n.find(e=>e.default)??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:n,tabValues:r})),[o,d]=f({queryString:a,groupId:l}),[h,x]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[a,l]=(0,u.Dv)(n);return[a,(0,s.useCallback)(e=>{n&&l.set(e)},[n,l])]}({groupId:l}),g=(()=>{const e=o??h;return m({value:e,tabValues:r})?e:null})();(0,c.A)(()=>{g&&t(g)},[g]);return{selectedValue:i,selectValue:(0,s.useCallback)(e=>{if(!m({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);t(e),d(e),x(e)},[d,x,r]),tabValues:r}}var g=a(1062);const _={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var j=a(4848);function v({className:e,block:n,selectedValue:a,selectValue:s,tabValues:r}){const t=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.a_)(),o=e=>{const n=e.currentTarget,l=t.indexOf(n),i=r[l].value;i!==a&&(c(n),s(i))},d=e=>{let n=null;switch(e.key){case"Enter":o(e);break;case"ArrowRight":{const a=t.indexOf(e.currentTarget)+1;n=t[a]??t[0];break}case"ArrowLeft":{const a=t.indexOf(e.currentTarget)-1;n=t[a]??t[t.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.A)("tabs",{"tabs--block":n},e),children:r.map(({value:e,label:n,attributes:s})=>(0,j.jsx)("li",{role:"tab",tabIndex:a===e?0:-1,"aria-selected":a===e,ref:e=>{t.push(e)},onKeyDown:d,onClick:o,...s,className:(0,l.A)("tabs__item",_.tabItem,s?.className,{"tabs__item--active":a===e}),children:n??e},e))})}function y({lazy:e,children:n,selectedValue:a}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===a);return e?(0,s.cloneElement)(e,{className:(0,l.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==a}))})}function b(e){const n=x(e);return(0,j.jsxs)("div",{className:(0,l.A)(r.G.tabs.container,"tabs-container",_.tabList),
1children:[(0,j.jsx)(v,{...n,...e}),(0,j.jsx)(y,{...n,...e})]})}function w(e){const n=(0,g.A)();return(0,j.jsx)(b,{...e,children:h(e.children)},String(n))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.