$allow_access_desc = __( 'When enabled, AI models can access and interact with the terms in this taxonomy using supported integrations. This feature uses the WordPress Abilities API.', 'acf' ); $ai_description_label = __( 'AI Guidance for Taxonomy', 'acf' ); $ai_description_desc = __( "Add a short explanation of what this taxonomy is for. The clearer your description, the better the AI's output will be.", 'acf' ); } if ( 'acf_field_group' === $item_type ) { $allow_access_label = __( 'Allow AI Access to Field Data', 'acf' ); $allow_access_desc = __( 'When enabled, AI models can access and interact with the fields in this group using supported integrations. This feature uses the WordPress Abilities API.', 'acf' ); $ai_description_label = __( 'AI Context Description', 'acf' ); $ai_description_desc = __( "Add a short explanation of what this field group is for. The clearer your description, the better the AI's output will be.", 'acf' ); } acf_render_field_wrap( array( 'type' => 'true_false', 'name' => 'allow_ai_access', 'key' => 'allow_ai_access', 'prefix' => $item_type, 'value' => $allow_ai_access_val, 'label' => $allow_access_label, 'instructions' => $allow_access_desc, 'ui' => true, 'default' => 1, ) ); acf_render_field_wrap( array( 'type' => 'textarea', 'name' => 'ai_description', 'key' => 'ai_description', 'prefix' => $item_type, 'value' => $item['ai_description'] ?? '', 'label' => $ai_description_label, 'instructions' => $ai_description_desc, 'rows' => 4, 'conditions' => array( array( 'field' => 'allow_ai_access', 'operator' => '==', 'value' => '1', ), ), ), 'div', 'field' ); } }