aidevops 2.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/AGENTS.md +614 -0
- package/.agent/accounts.md +65 -0
- package/.agent/aidevops/add-new-mcp-to-aidevops.md +456 -0
- package/.agent/aidevops/api-integrations.md +335 -0
- package/.agent/aidevops/architecture.md +510 -0
- package/.agent/aidevops/configs.md +274 -0
- package/.agent/aidevops/docs.md +244 -0
- package/.agent/aidevops/extension.md +311 -0
- package/.agent/aidevops/mcp-integrations.md +340 -0
- package/.agent/aidevops/mcp-troubleshooting.md +162 -0
- package/.agent/aidevops/memory-patterns.md +172 -0
- package/.agent/aidevops/providers.md +217 -0
- package/.agent/aidevops/recommendations.md +321 -0
- package/.agent/aidevops/requirements.md +301 -0
- package/.agent/aidevops/resources.md +214 -0
- package/.agent/aidevops/security-requirements.md +174 -0
- package/.agent/aidevops/security.md +350 -0
- package/.agent/aidevops/service-links.md +400 -0
- package/.agent/aidevops/services.md +357 -0
- package/.agent/aidevops/setup.md +153 -0
- package/.agent/aidevops/troubleshooting.md +389 -0
- package/.agent/aidevops.md +124 -0
- package/.agent/build-plus.md +244 -0
- package/.agent/content/guidelines.md +109 -0
- package/.agent/content.md +87 -0
- package/.agent/health.md +59 -0
- package/.agent/legal.md +59 -0
- package/.agent/loop-state/full-loop.local.md +16 -0
- package/.agent/loop-state/ralph-loop.local.md +10 -0
- package/.agent/marketing.md +440 -0
- package/.agent/memory/README.md +260 -0
- package/.agent/onboarding.md +796 -0
- package/.agent/plan-plus.md +245 -0
- package/.agent/research.md +100 -0
- package/.agent/sales.md +333 -0
- package/.agent/scripts/101domains-helper.sh +701 -0
- package/.agent/scripts/add-missing-returns.sh +140 -0
- package/.agent/scripts/agent-browser-helper.sh +311 -0
- package/.agent/scripts/agno-setup.sh +712 -0
- package/.agent/scripts/ahrefs-mcp-wrapper.js +168 -0
- package/.agent/scripts/aidevops-update-check.sh +71 -0
- package/.agent/scripts/ampcode-cli.sh +522 -0
- package/.agent/scripts/auto-version-bump.sh +156 -0
- package/.agent/scripts/autogen-helper.sh +512 -0
- package/.agent/scripts/beads-sync-helper.sh +596 -0
- package/.agent/scripts/closte-helper.sh +5 -0
- package/.agent/scripts/cloudron-helper.sh +321 -0
- package/.agent/scripts/codacy-cli-chunked.sh +581 -0
- package/.agent/scripts/codacy-cli.sh +442 -0
- package/.agent/scripts/code-audit-helper.sh +5 -0
- package/.agent/scripts/coderabbit-cli.sh +417 -0
- package/.agent/scripts/coderabbit-pro-analysis.sh +238 -0
- package/.agent/scripts/commands/code-simplifier.md +86 -0
- package/.agent/scripts/commands/full-loop.md +246 -0
- package/.agent/scripts/commands/postflight-loop.md +103 -0
- package/.agent/scripts/commands/recall.md +182 -0
- package/.agent/scripts/commands/remember.md +132 -0
- package/.agent/scripts/commands/save-todo.md +175 -0
- package/.agent/scripts/commands/session-review.md +154 -0
- package/.agent/scripts/comprehensive-quality-fix.sh +106 -0
- package/.agent/scripts/context-builder-helper.sh +522 -0
- package/.agent/scripts/coolify-cli-helper.sh +674 -0
- package/.agent/scripts/coolify-helper.sh +380 -0
- package/.agent/scripts/crawl4ai-examples.sh +401 -0
- package/.agent/scripts/crawl4ai-helper.sh +1078 -0
- package/.agent/scripts/crewai-helper.sh +681 -0
- package/.agent/scripts/dev-browser-helper.sh +513 -0
- package/.agent/scripts/dns-helper.sh +396 -0
- package/.agent/scripts/domain-research-helper.sh +917 -0
- package/.agent/scripts/dspy-helper.sh +285 -0
- package/.agent/scripts/dspyground-helper.sh +291 -0
- package/.agent/scripts/eeat-score-helper.sh +1242 -0
- package/.agent/scripts/efficient-return-fix.sh +92 -0
- package/.agent/scripts/extract-opencode-prompts.sh +128 -0
- package/.agent/scripts/find-missing-returns.sh +113 -0
- package/.agent/scripts/fix-auth-headers.sh +104 -0
- package/.agent/scripts/fix-common-strings.sh +254 -0
- package/.agent/scripts/fix-content-type.sh +100 -0
- package/.agent/scripts/fix-error-messages.sh +130 -0
- package/.agent/scripts/fix-misplaced-returns.sh +74 -0
- package/.agent/scripts/fix-remaining-literals.sh +152 -0
- package/.agent/scripts/fix-return-statements.sh +41 -0
- package/.agent/scripts/fix-s131-default-cases.sh +249 -0
- package/.agent/scripts/fix-sc2155-simple.sh +102 -0
- package/.agent/scripts/fix-shellcheck-critical.sh +187 -0
- package/.agent/scripts/fix-string-literals.sh +273 -0
- package/.agent/scripts/full-loop-helper.sh +773 -0
- package/.agent/scripts/generate-opencode-agents.sh +497 -0
- package/.agent/scripts/generate-opencode-commands.sh +1629 -0
- package/.agent/scripts/generate-skills.sh +366 -0
- package/.agent/scripts/git-platforms-helper.sh +640 -0
- package/.agent/scripts/gitea-cli-helper.sh +743 -0
- package/.agent/scripts/github-cli-helper.sh +702 -0
- package/.agent/scripts/gitlab-cli-helper.sh +682 -0
- package/.agent/scripts/gsc-add-user-helper.sh +325 -0
- package/.agent/scripts/gsc-sitemap-helper.sh +678 -0
- package/.agent/scripts/hetzner-helper.sh +485 -0
- package/.agent/scripts/hostinger-helper.sh +229 -0
- package/.agent/scripts/keyword-research-helper.sh +1815 -0
- package/.agent/scripts/langflow-helper.sh +544 -0
- package/.agent/scripts/linkedin-automation.py +241 -0
- package/.agent/scripts/linter-manager.sh +599 -0
- package/.agent/scripts/linters-local.sh +434 -0
- package/.agent/scripts/list-keys-helper.sh +488 -0
- package/.agent/scripts/local-browser-automation.py +339 -0
- package/.agent/scripts/localhost-helper.sh +744 -0
- package/.agent/scripts/loop-common.sh +806 -0
- package/.agent/scripts/mainwp-helper.sh +728 -0
- package/.agent/scripts/markdown-formatter.sh +338 -0
- package/.agent/scripts/markdown-lint-fix.sh +311 -0
- package/.agent/scripts/mass-fix-returns.sh +58 -0
- package/.agent/scripts/mcp-diagnose.sh +167 -0
- package/.agent/scripts/mcp-inspector-helper.sh +449 -0
- package/.agent/scripts/memory-helper.sh +650 -0
- package/.agent/scripts/monitor-code-review.sh +255 -0
- package/.agent/scripts/onboarding-helper.sh +706 -0
- package/.agent/scripts/opencode-github-setup-helper.sh +797 -0
- package/.agent/scripts/opencode-test-helper.sh +213 -0
- package/.agent/scripts/pagespeed-helper.sh +464 -0
- package/.agent/scripts/pandoc-helper.sh +362 -0
- package/.agent/scripts/postflight-check.sh +555 -0
- package/.agent/scripts/pre-commit-hook.sh +259 -0
- package/.agent/scripts/pre-edit-check.sh +169 -0
- package/.agent/scripts/qlty-cli.sh +356 -0
- package/.agent/scripts/quality-cli-manager.sh +525 -0
- package/.agent/scripts/quality-feedback-helper.sh +462 -0
- package/.agent/scripts/quality-fix.sh +263 -0
- package/.agent/scripts/quality-loop-helper.sh +1108 -0
- package/.agent/scripts/ralph-loop-helper.sh +836 -0
- package/.agent/scripts/ralph-upstream-check.sh +341 -0
- package/.agent/scripts/secretlint-helper.sh +847 -0
- package/.agent/scripts/servers-helper.sh +241 -0
- package/.agent/scripts/ses-helper.sh +619 -0
- package/.agent/scripts/session-review-helper.sh +404 -0
- package/.agent/scripts/setup-linters-wizard.sh +379 -0
- package/.agent/scripts/setup-local-api-keys.sh +330 -0
- package/.agent/scripts/setup-mcp-integrations.sh +472 -0
- package/.agent/scripts/shared-constants.sh +246 -0
- package/.agent/scripts/site-crawler-helper.sh +1487 -0
- package/.agent/scripts/snyk-helper.sh +940 -0
- package/.agent/scripts/sonarcloud-autofix.sh +193 -0
- package/.agent/scripts/sonarcloud-cli.sh +191 -0
- package/.agent/scripts/sonarscanner-cli.sh +455 -0
- package/.agent/scripts/spaceship-helper.sh +747 -0
- package/.agent/scripts/stagehand-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-setup.sh +441 -0
- package/.agent/scripts/stagehand-setup.sh +439 -0
- package/.agent/scripts/system-cleanup.sh +340 -0
- package/.agent/scripts/terminal-title-helper.sh +388 -0
- package/.agent/scripts/terminal-title-setup.sh +549 -0
- package/.agent/scripts/test-stagehand-both-integration.sh +317 -0
- package/.agent/scripts/test-stagehand-integration.sh +309 -0
- package/.agent/scripts/test-stagehand-python-integration.sh +341 -0
- package/.agent/scripts/todo-ready.sh +263 -0
- package/.agent/scripts/tool-version-check.sh +362 -0
- package/.agent/scripts/toon-helper.sh +469 -0
- package/.agent/scripts/twilio-helper.sh +917 -0
- package/.agent/scripts/updown-helper.sh +279 -0
- package/.agent/scripts/validate-mcp-integrations.sh +250 -0
- package/.agent/scripts/validate-version-consistency.sh +131 -0
- package/.agent/scripts/vaultwarden-helper.sh +597 -0
- package/.agent/scripts/vercel-cli-helper.sh +816 -0
- package/.agent/scripts/verify-mirrors.sh +169 -0
- package/.agent/scripts/version-manager.sh +831 -0
- package/.agent/scripts/webhosting-helper.sh +471 -0
- package/.agent/scripts/webhosting-verify.sh +238 -0
- package/.agent/scripts/wordpress-mcp-helper.sh +508 -0
- package/.agent/scripts/worktree-helper.sh +595 -0
- package/.agent/scripts/worktree-sessions.sh +577 -0
- package/.agent/seo/dataforseo.md +215 -0
- package/.agent/seo/domain-research.md +532 -0
- package/.agent/seo/eeat-score.md +659 -0
- package/.agent/seo/google-search-console.md +366 -0
- package/.agent/seo/gsc-sitemaps.md +282 -0
- package/.agent/seo/keyword-research.md +521 -0
- package/.agent/seo/serper.md +278 -0
- package/.agent/seo/site-crawler.md +387 -0
- package/.agent/seo.md +236 -0
- package/.agent/services/accounting/quickfile.md +159 -0
- package/.agent/services/communications/telfon.md +470 -0
- package/.agent/services/communications/twilio.md +569 -0
- package/.agent/services/crm/fluentcrm.md +449 -0
- package/.agent/services/email/ses.md +399 -0
- package/.agent/services/hosting/101domains.md +378 -0
- package/.agent/services/hosting/closte.md +177 -0
- package/.agent/services/hosting/cloudflare.md +251 -0
- package/.agent/services/hosting/cloudron.md +478 -0
- package/.agent/services/hosting/dns-providers.md +335 -0
- package/.agent/services/hosting/domain-purchasing.md +344 -0
- package/.agent/services/hosting/hetzner.md +327 -0
- package/.agent/services/hosting/hostinger.md +287 -0
- package/.agent/services/hosting/localhost.md +419 -0
- package/.agent/services/hosting/spaceship.md +353 -0
- package/.agent/services/hosting/webhosting.md +330 -0
- package/.agent/social-media.md +69 -0
- package/.agent/templates/plans-template.md +114 -0
- package/.agent/templates/prd-template.md +129 -0
- package/.agent/templates/tasks-template.md +108 -0
- package/.agent/templates/todo-template.md +89 -0
- package/.agent/tools/ai-assistants/agno.md +471 -0
- package/.agent/tools/ai-assistants/capsolver.md +326 -0
- package/.agent/tools/ai-assistants/configuration.md +221 -0
- package/.agent/tools/ai-assistants/overview.md +209 -0
- package/.agent/tools/ai-assistants/status.md +171 -0
- package/.agent/tools/ai-assistants/windsurf.md +193 -0
- package/.agent/tools/ai-orchestration/autogen.md +406 -0
- package/.agent/tools/ai-orchestration/crewai.md +445 -0
- package/.agent/tools/ai-orchestration/langflow.md +405 -0
- package/.agent/tools/ai-orchestration/openprose.md +487 -0
- package/.agent/tools/ai-orchestration/overview.md +362 -0
- package/.agent/tools/ai-orchestration/packaging.md +647 -0
- package/.agent/tools/browser/agent-browser.md +464 -0
- package/.agent/tools/browser/browser-automation.md +400 -0
- package/.agent/tools/browser/chrome-devtools.md +282 -0
- package/.agent/tools/browser/crawl4ai-integration.md +422 -0
- package/.agent/tools/browser/crawl4ai-resources.md +277 -0
- package/.agent/tools/browser/crawl4ai-usage.md +416 -0
- package/.agent/tools/browser/crawl4ai.md +585 -0
- package/.agent/tools/browser/dev-browser.md +341 -0
- package/.agent/tools/browser/pagespeed.md +260 -0
- package/.agent/tools/browser/playwright.md +266 -0
- package/.agent/tools/browser/playwriter.md +310 -0
- package/.agent/tools/browser/stagehand-examples.md +456 -0
- package/.agent/tools/browser/stagehand-python.md +483 -0
- package/.agent/tools/browser/stagehand.md +421 -0
- package/.agent/tools/build-agent/agent-review.md +224 -0
- package/.agent/tools/build-agent/build-agent.md +784 -0
- package/.agent/tools/build-mcp/aidevops-plugin.md +476 -0
- package/.agent/tools/build-mcp/api-wrapper.md +445 -0
- package/.agent/tools/build-mcp/build-mcp.md +240 -0
- package/.agent/tools/build-mcp/deployment.md +401 -0
- package/.agent/tools/build-mcp/server-patterns.md +632 -0
- package/.agent/tools/build-mcp/transports.md +366 -0
- package/.agent/tools/code-review/auditing.md +383 -0
- package/.agent/tools/code-review/automation.md +219 -0
- package/.agent/tools/code-review/best-practices.md +203 -0
- package/.agent/tools/code-review/codacy.md +151 -0
- package/.agent/tools/code-review/code-simplifier.md +174 -0
- package/.agent/tools/code-review/code-standards.md +309 -0
- package/.agent/tools/code-review/coderabbit.md +101 -0
- package/.agent/tools/code-review/management.md +155 -0
- package/.agent/tools/code-review/qlty.md +248 -0
- package/.agent/tools/code-review/secretlint.md +565 -0
- package/.agent/tools/code-review/setup.md +250 -0
- package/.agent/tools/code-review/snyk.md +563 -0
- package/.agent/tools/code-review/tools.md +230 -0
- package/.agent/tools/content/summarize.md +353 -0
- package/.agent/tools/context/augment-context-engine.md +468 -0
- package/.agent/tools/context/context-builder-agent.md +76 -0
- package/.agent/tools/context/context-builder.md +375 -0
- package/.agent/tools/context/context7.md +371 -0
- package/.agent/tools/context/dspy.md +302 -0
- package/.agent/tools/context/dspyground.md +374 -0
- package/.agent/tools/context/llm-tldr.md +219 -0
- package/.agent/tools/context/osgrep.md +488 -0
- package/.agent/tools/context/prompt-optimization.md +338 -0
- package/.agent/tools/context/toon.md +292 -0
- package/.agent/tools/conversion/pandoc.md +304 -0
- package/.agent/tools/credentials/api-key-management.md +154 -0
- package/.agent/tools/credentials/api-key-setup.md +224 -0
- package/.agent/tools/credentials/environment-variables.md +180 -0
- package/.agent/tools/credentials/vaultwarden.md +382 -0
- package/.agent/tools/data-extraction/outscraper.md +974 -0
- package/.agent/tools/deployment/coolify-cli.md +388 -0
- package/.agent/tools/deployment/coolify-setup.md +353 -0
- package/.agent/tools/deployment/coolify.md +345 -0
- package/.agent/tools/deployment/vercel.md +390 -0
- package/.agent/tools/git/authentication.md +132 -0
- package/.agent/tools/git/gitea-cli.md +193 -0
- package/.agent/tools/git/github-actions.md +207 -0
- package/.agent/tools/git/github-cli.md +223 -0
- package/.agent/tools/git/gitlab-cli.md +190 -0
- package/.agent/tools/git/opencode-github-security.md +350 -0
- package/.agent/tools/git/opencode-github.md +328 -0
- package/.agent/tools/git/opencode-gitlab.md +252 -0
- package/.agent/tools/git/security.md +196 -0
- package/.agent/tools/git.md +207 -0
- package/.agent/tools/opencode/oh-my-opencode.md +375 -0
- package/.agent/tools/opencode/opencode-anthropic-auth.md +446 -0
- package/.agent/tools/opencode/opencode.md +651 -0
- package/.agent/tools/social-media/bird.md +437 -0
- package/.agent/tools/task-management/beads.md +336 -0
- package/.agent/tools/terminal/terminal-title.md +251 -0
- package/.agent/tools/ui/shadcn.md +196 -0
- package/.agent/tools/ui/ui-skills.md +115 -0
- package/.agent/tools/wordpress/localwp.md +311 -0
- package/.agent/tools/wordpress/mainwp.md +391 -0
- package/.agent/tools/wordpress/scf.md +527 -0
- package/.agent/tools/wordpress/wp-admin.md +729 -0
- package/.agent/tools/wordpress/wp-dev.md +940 -0
- package/.agent/tools/wordpress/wp-preferred.md +398 -0
- package/.agent/tools/wordpress.md +95 -0
- package/.agent/workflows/branch/bugfix.md +63 -0
- package/.agent/workflows/branch/chore.md +95 -0
- package/.agent/workflows/branch/experiment.md +115 -0
- package/.agent/workflows/branch/feature.md +59 -0
- package/.agent/workflows/branch/hotfix.md +98 -0
- package/.agent/workflows/branch/refactor.md +92 -0
- package/.agent/workflows/branch/release.md +96 -0
- package/.agent/workflows/branch.md +347 -0
- package/.agent/workflows/bug-fixing.md +267 -0
- package/.agent/workflows/changelog.md +129 -0
- package/.agent/workflows/code-audit-remote.md +279 -0
- package/.agent/workflows/conversation-starter.md +69 -0
- package/.agent/workflows/error-feedback.md +578 -0
- package/.agent/workflows/feature-development.md +355 -0
- package/.agent/workflows/git-workflow.md +702 -0
- package/.agent/workflows/multi-repo-workspace.md +268 -0
- package/.agent/workflows/plans.md +709 -0
- package/.agent/workflows/postflight.md +604 -0
- package/.agent/workflows/pr.md +571 -0
- package/.agent/workflows/preflight.md +278 -0
- package/.agent/workflows/ralph-loop.md +773 -0
- package/.agent/workflows/release.md +498 -0
- package/.agent/workflows/session-manager.md +254 -0
- package/.agent/workflows/session-review.md +311 -0
- package/.agent/workflows/sql-migrations.md +631 -0
- package/.agent/workflows/version-bump.md +283 -0
- package/.agent/workflows/wiki-update.md +333 -0
- package/.agent/workflows/worktree.md +477 -0
- package/LICENSE +21 -0
- package/README.md +1446 -0
- package/VERSION +1 -0
- package/aidevops.sh +1746 -0
- package/bin/aidevops +21 -0
- package/package.json +75 -0
- package/scripts/npm-postinstall.js +60 -0
- package/setup.sh +2366 -0
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Secure Custom Fields (SCF) / Advanced Custom Fields (ACF) - field groups, data schema, programmatic updates
|
|
3
|
+
mode: subagent
|
|
4
|
+
temperature: 0.2
|
|
5
|
+
tools:
|
|
6
|
+
write: true
|
|
7
|
+
edit: true
|
|
8
|
+
bash: true
|
|
9
|
+
read: true
|
|
10
|
+
glob: true
|
|
11
|
+
grep: true
|
|
12
|
+
webfetch: true
|
|
13
|
+
task: true
|
|
14
|
+
wordpress-mcp_*: true
|
|
15
|
+
context7_*: true
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Secure Custom Fields (SCF) / ACF Subagent
|
|
19
|
+
|
|
20
|
+
<!-- AI-CONTEXT-START -->
|
|
21
|
+
## Quick Reference
|
|
22
|
+
|
|
23
|
+
- **Plugin**: Secure Custom Fields (SCF) - community fork of ACF
|
|
24
|
+
- **Field Groups**: Stored as `acf-field-group` post type
|
|
25
|
+
- **Fields**: Stored as `acf-field` post type
|
|
26
|
+
- **Meta Storage**: `{field_name}` for value, `_{field_name}` for field key reference
|
|
27
|
+
|
|
28
|
+
**Critical Rules**:
|
|
29
|
+
1. **Select fields**: Set `return_format` to "value" and save the value KEY not label
|
|
30
|
+
2. **Checkbox fields**: Set `return_format` to "value", save array of choice KEYS
|
|
31
|
+
3. **Group sub-fields**: Must be stored as SEPARATE `acf-field` posts with `post_parent` = group ID
|
|
32
|
+
4. **Field key references**: Always set `_{field_name}` meta to the field key for ACF to recognize values
|
|
33
|
+
|
|
34
|
+
**Common Issues**:
|
|
35
|
+
- Field shows wrong value: Missing `_{field_name}` meta key reference
|
|
36
|
+
- Group sub-fields not saving: Sub-fields stored in `post_content` instead of separate posts
|
|
37
|
+
- Select shows default: `return_format` not set to "value"
|
|
38
|
+
|
|
39
|
+
<!-- AI-CONTEXT-END -->
|
|
40
|
+
|
|
41
|
+
## Overview
|
|
42
|
+
|
|
43
|
+
This subagent handles Secure Custom Fields (SCF) and Advanced Custom Fields (ACF) tasks:
|
|
44
|
+
|
|
45
|
+
- Field group design and creation
|
|
46
|
+
- Programmatic field updates via WP-CLI/PHP
|
|
47
|
+
- Data import with proper field key references
|
|
48
|
+
- Troubleshooting field display issues
|
|
49
|
+
|
|
50
|
+
## Database Schema
|
|
51
|
+
|
|
52
|
+
### Field Groups
|
|
53
|
+
|
|
54
|
+
Field groups are stored as posts with `post_type = 'acf-field-group'`:
|
|
55
|
+
|
|
56
|
+
```sql
|
|
57
|
+
SELECT ID, post_title, post_name, post_status
|
|
58
|
+
FROM wp_posts
|
|
59
|
+
WHERE post_type = 'acf-field-group';
|
|
60
|
+
```text
|
|
61
|
+
|
|
62
|
+
| Column | Purpose |
|
|
63
|
+
|--------|---------|
|
|
64
|
+
| `ID` | Field group ID |
|
|
65
|
+
| `post_title` | Display name |
|
|
66
|
+
| `post_name` | Unique key (e.g., `group_abc123`) |
|
|
67
|
+
| `post_content` | Serialized settings (location rules, etc.) |
|
|
68
|
+
| `post_status` | `publish` or `acf-disabled` |
|
|
69
|
+
|
|
70
|
+
### Fields
|
|
71
|
+
|
|
72
|
+
Fields are stored as posts with `post_type = 'acf-field'`:
|
|
73
|
+
|
|
74
|
+
```sql
|
|
75
|
+
SELECT ID, post_title, post_name, post_excerpt, post_parent, menu_order
|
|
76
|
+
FROM wp_posts
|
|
77
|
+
WHERE post_type = 'acf-field' AND post_parent = {group_id}
|
|
78
|
+
ORDER BY menu_order;
|
|
79
|
+
```text
|
|
80
|
+
|
|
81
|
+
| Column | Purpose |
|
|
82
|
+
|--------|---------|
|
|
83
|
+
| `ID` | Field ID |
|
|
84
|
+
| `post_title` | Field label |
|
|
85
|
+
| `post_name` | Field key (e.g., `field_abc123`) |
|
|
86
|
+
| `post_excerpt` | Field name (used in meta_key) |
|
|
87
|
+
| `post_parent` | Parent field group ID (or parent group field ID for sub-fields) |
|
|
88
|
+
| `post_content` | Serialized field configuration |
|
|
89
|
+
| `menu_order` | Display order |
|
|
90
|
+
|
|
91
|
+
### Field Values (Post Meta)
|
|
92
|
+
|
|
93
|
+
Field values are stored in `wp_postmeta`:
|
|
94
|
+
|
|
95
|
+
| Meta Key | Purpose |
|
|
96
|
+
|----------|---------|
|
|
97
|
+
| `{field_name}` | The actual value |
|
|
98
|
+
| `_{field_name}` | Field key reference (REQUIRED for ACF to recognize) |
|
|
99
|
+
|
|
100
|
+
**Example**:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
meta_key: import_source
|
|
104
|
+
meta_value: outscraper
|
|
105
|
+
|
|
106
|
+
meta_key: _import_source
|
|
107
|
+
meta_value: field_import_source
|
|
108
|
+
```text
|
|
109
|
+
|
|
110
|
+
## Critical: Group Fields with Sub-Fields
|
|
111
|
+
|
|
112
|
+
### Wrong Way (Causes Issues)
|
|
113
|
+
|
|
114
|
+
Storing sub-fields inside the group's `post_content`:
|
|
115
|
+
|
|
116
|
+
```php
|
|
117
|
+
// DON'T DO THIS - sub-fields in post_content don't work properly
|
|
118
|
+
$group_config = [
|
|
119
|
+
'type' => 'group',
|
|
120
|
+
'name' => 'my_group',
|
|
121
|
+
'sub_fields' => [
|
|
122
|
+
['key' => 'field_sub1', 'name' => 'sub1', 'type' => 'text'],
|
|
123
|
+
['key' => 'field_sub2', 'name' => 'sub2', 'type' => 'select'],
|
|
124
|
+
]
|
|
125
|
+
];
|
|
126
|
+
```text
|
|
127
|
+
|
|
128
|
+
### Correct Way (Works Properly)
|
|
129
|
+
|
|
130
|
+
Store sub-fields as **separate `acf-field` posts** with `post_parent` set to the group field's ID:
|
|
131
|
+
|
|
132
|
+
```php
|
|
133
|
+
// 1. Create the group field (empty sub_fields)
|
|
134
|
+
$group_data = [
|
|
135
|
+
'post_title' => 'My Group',
|
|
136
|
+
'post_name' => 'field_my_group',
|
|
137
|
+
'post_excerpt' => 'my_group',
|
|
138
|
+
'post_type' => 'acf-field',
|
|
139
|
+
'post_status' => 'publish',
|
|
140
|
+
'post_parent' => $field_group_id, // Parent is the field GROUP
|
|
141
|
+
'menu_order' => 0,
|
|
142
|
+
'post_content' => serialize([
|
|
143
|
+
'type' => 'group',
|
|
144
|
+
'name' => 'my_group',
|
|
145
|
+
'key' => 'field_my_group',
|
|
146
|
+
'label' => 'My Group',
|
|
147
|
+
'layout' => 'block',
|
|
148
|
+
'sub_fields' => [] // Empty - sub-fields are separate posts
|
|
149
|
+
])
|
|
150
|
+
];
|
|
151
|
+
$group_field_id = wp_insert_post($group_data);
|
|
152
|
+
|
|
153
|
+
// 2. Create each sub-field as a separate post
|
|
154
|
+
$sub_field_data = [
|
|
155
|
+
'post_title' => 'Sub Field 1',
|
|
156
|
+
'post_name' => 'field_sub1',
|
|
157
|
+
'post_excerpt' => 'sub1',
|
|
158
|
+
'post_type' => 'acf-field',
|
|
159
|
+
'post_status' => 'publish',
|
|
160
|
+
'post_parent' => $group_field_id, // Parent is the GROUP FIELD, not field group
|
|
161
|
+
'menu_order' => 0,
|
|
162
|
+
'post_content' => serialize([
|
|
163
|
+
'key' => 'field_sub1',
|
|
164
|
+
'name' => 'sub1',
|
|
165
|
+
'label' => 'Sub Field 1',
|
|
166
|
+
'type' => 'text'
|
|
167
|
+
])
|
|
168
|
+
];
|
|
169
|
+
wp_insert_post($sub_field_data);
|
|
170
|
+
```text
|
|
171
|
+
|
|
172
|
+
## Field Type Configuration
|
|
173
|
+
|
|
174
|
+
### Select Fields
|
|
175
|
+
|
|
176
|
+
**Required settings**:
|
|
177
|
+
- `return_format`: Must be `"value"` to return the choice key
|
|
178
|
+
- `multiple`: `0` for single, `1` for multiple
|
|
179
|
+
- `choices`: Array of `key => label` pairs
|
|
180
|
+
|
|
181
|
+
```php
|
|
182
|
+
$select_config = [
|
|
183
|
+
'key' => 'field_my_select',
|
|
184
|
+
'name' => 'my_select',
|
|
185
|
+
'label' => 'My Select',
|
|
186
|
+
'type' => 'select',
|
|
187
|
+
'choices' => [
|
|
188
|
+
'option1' => 'Option One',
|
|
189
|
+
'option2' => 'Option Two',
|
|
190
|
+
],
|
|
191
|
+
'default_value' => 'option1',
|
|
192
|
+
'return_format' => 'value', // CRITICAL
|
|
193
|
+
'multiple' => 0
|
|
194
|
+
];
|
|
195
|
+
```text
|
|
196
|
+
|
|
197
|
+
**Saving values**: Use the choice KEY, not the label:
|
|
198
|
+
|
|
199
|
+
```php
|
|
200
|
+
// Correct
|
|
201
|
+
update_field('my_select', 'option1', $post_id);
|
|
202
|
+
|
|
203
|
+
// Wrong - will not match
|
|
204
|
+
update_field('my_select', 'Option One', $post_id);
|
|
205
|
+
```text
|
|
206
|
+
|
|
207
|
+
### Checkbox Fields
|
|
208
|
+
|
|
209
|
+
**Required settings**:
|
|
210
|
+
- `return_format`: Must be `"value"` to return choice keys
|
|
211
|
+
- `choices`: Array of `key => label` pairs
|
|
212
|
+
|
|
213
|
+
```php
|
|
214
|
+
$checkbox_config = [
|
|
215
|
+
'key' => 'field_my_checkboxes',
|
|
216
|
+
'name' => 'my_checkboxes',
|
|
217
|
+
'label' => 'My Checkboxes',
|
|
218
|
+
'type' => 'checkbox',
|
|
219
|
+
'choices' => [
|
|
220
|
+
'Google My Business' => 'Google My Business',
|
|
221
|
+
'Facebook Page' => 'Facebook Page',
|
|
222
|
+
],
|
|
223
|
+
'return_format' => 'value' // CRITICAL
|
|
224
|
+
];
|
|
225
|
+
```text
|
|
226
|
+
|
|
227
|
+
**Saving values**: Use array of choice keys:
|
|
228
|
+
|
|
229
|
+
```php
|
|
230
|
+
update_field('my_checkboxes', ['Google My Business', 'Facebook Page'], $post_id);
|
|
231
|
+
```text
|
|
232
|
+
|
|
233
|
+
### True/False Fields
|
|
234
|
+
|
|
235
|
+
```php
|
|
236
|
+
$boolean_config = [
|
|
237
|
+
'key' => 'field_my_toggle',
|
|
238
|
+
'name' => 'my_toggle',
|
|
239
|
+
'label' => 'My Toggle',
|
|
240
|
+
'type' => 'true_false',
|
|
241
|
+
'default_value' => 0,
|
|
242
|
+
'ui' => 1 // Show as toggle switch
|
|
243
|
+
];
|
|
244
|
+
```text
|
|
245
|
+
|
|
246
|
+
**Saving values**:
|
|
247
|
+
|
|
248
|
+
```php
|
|
249
|
+
update_field('my_toggle', 1, $post_id); // or true
|
|
250
|
+
update_field('my_toggle', 0, $post_id); // or false
|
|
251
|
+
```text
|
|
252
|
+
|
|
253
|
+
### Date/Time Picker Fields
|
|
254
|
+
|
|
255
|
+
```php
|
|
256
|
+
$datetime_config = [
|
|
257
|
+
'key' => 'field_my_datetime',
|
|
258
|
+
'name' => 'my_datetime',
|
|
259
|
+
'label' => 'My DateTime',
|
|
260
|
+
'type' => 'date_time_picker',
|
|
261
|
+
'display_format' => 'd/m/Y H:i',
|
|
262
|
+
'return_format' => 'Y-m-d H:i:s'
|
|
263
|
+
];
|
|
264
|
+
```text
|
|
265
|
+
|
|
266
|
+
## Programmatic Field Updates
|
|
267
|
+
|
|
268
|
+
### Using update_field()
|
|
269
|
+
|
|
270
|
+
```php
|
|
271
|
+
// Simple field
|
|
272
|
+
update_field('field_name', 'value', $post_id);
|
|
273
|
+
|
|
274
|
+
// With field key reference (recommended for imports)
|
|
275
|
+
update_field('field_name', 'value', $post_id);
|
|
276
|
+
update_post_meta($post_id, '_field_name', 'field_key_here');
|
|
277
|
+
```text
|
|
278
|
+
|
|
279
|
+
### Group Sub-Fields
|
|
280
|
+
|
|
281
|
+
For fields inside a group, use the full prefixed name:
|
|
282
|
+
|
|
283
|
+
```php
|
|
284
|
+
// Group: import_metadata
|
|
285
|
+
// Sub-field: import_source
|
|
286
|
+
|
|
287
|
+
// Method 1: Full name
|
|
288
|
+
update_field('import_metadata_import_source', 'outscraper', $post_id);
|
|
289
|
+
update_post_meta($post_id, '_import_metadata_import_source', 'field_import_source');
|
|
290
|
+
|
|
291
|
+
// Method 2: Via group array (less reliable)
|
|
292
|
+
update_field('import_metadata', [
|
|
293
|
+
'import_source' => 'outscraper',
|
|
294
|
+
'import_query' => 'test'
|
|
295
|
+
], $post_id);
|
|
296
|
+
```text
|
|
297
|
+
|
|
298
|
+
### Conditional Fields (Checkbox-Controlled)
|
|
299
|
+
|
|
300
|
+
When a field's visibility depends on a checkbox:
|
|
301
|
+
|
|
302
|
+
```php
|
|
303
|
+
// 1. First, set the checkbox values
|
|
304
|
+
update_field('social_media_social_media_links', ['Google My Business', 'Google Maps'], $post_id);
|
|
305
|
+
update_post_meta($post_id, '_social_media_social_media_links', 'field_646a475722f13');
|
|
306
|
+
|
|
307
|
+
// 2. Then set the conditional fields
|
|
308
|
+
update_field('social_media_google_my_business', 'maps.google.com/...', $post_id);
|
|
309
|
+
update_post_meta($post_id, '_social_media_google_my_business', 'field_646a486822f14');
|
|
310
|
+
```text
|
|
311
|
+
|
|
312
|
+
## Troubleshooting
|
|
313
|
+
|
|
314
|
+
### Field Shows Wrong/Default Value
|
|
315
|
+
|
|
316
|
+
**Symptom**: Database has correct value but UI shows default.
|
|
317
|
+
|
|
318
|
+
**Cause**: Missing field key reference (`_{field_name}` meta).
|
|
319
|
+
|
|
320
|
+
**Fix**:
|
|
321
|
+
|
|
322
|
+
```php
|
|
323
|
+
// Check if key reference exists
|
|
324
|
+
$key_ref = get_post_meta($post_id, '_field_name', true);
|
|
325
|
+
echo "Key ref: " . ($key_ref ?: 'MISSING');
|
|
326
|
+
|
|
327
|
+
// Set the key reference
|
|
328
|
+
update_post_meta($post_id, '_field_name', 'field_abc123');
|
|
329
|
+
```text
|
|
330
|
+
|
|
331
|
+
### Group Sub-Fields Not Saving
|
|
332
|
+
|
|
333
|
+
**Symptom**: Saving group fields puts values in wrong meta keys.
|
|
334
|
+
|
|
335
|
+
**Cause**: Sub-fields stored in group's `post_content` instead of separate posts.
|
|
336
|
+
|
|
337
|
+
**Diagnosis**:
|
|
338
|
+
|
|
339
|
+
```php
|
|
340
|
+
// Check if sub-fields are separate posts
|
|
341
|
+
global $wpdb;
|
|
342
|
+
$group_field_id = 123; // The group field's post ID
|
|
343
|
+
$sub_fields = $wpdb->get_results($wpdb->prepare(
|
|
344
|
+
"SELECT ID, post_name, post_excerpt FROM {$wpdb->posts}
|
|
345
|
+
WHERE post_type = 'acf-field' AND post_parent = %d",
|
|
346
|
+
$group_field_id
|
|
347
|
+
));
|
|
348
|
+
print_r($sub_fields);
|
|
349
|
+
// Should return sub-field posts, not empty
|
|
350
|
+
```text
|
|
351
|
+
|
|
352
|
+
**Fix**: Recreate the group with sub-fields as separate posts (see "Correct Way" above).
|
|
353
|
+
|
|
354
|
+
### Select Field Shows Default Despite Correct Value
|
|
355
|
+
|
|
356
|
+
**Symptom**: Select dropdown shows "Manual Entry" but database has "outscraper".
|
|
357
|
+
|
|
358
|
+
**Causes**:
|
|
359
|
+
1. `return_format` not set to "value"
|
|
360
|
+
2. Saving the label instead of the key
|
|
361
|
+
|
|
362
|
+
**Diagnosis**:
|
|
363
|
+
|
|
364
|
+
```php
|
|
365
|
+
// Check field configuration
|
|
366
|
+
$field = acf_get_field('field_key_here');
|
|
367
|
+
echo "return_format: " . ($field['return_format'] ?? 'NOT SET');
|
|
368
|
+
```text
|
|
369
|
+
|
|
370
|
+
**Fix via database**:
|
|
371
|
+
|
|
372
|
+
```php
|
|
373
|
+
global $wpdb;
|
|
374
|
+
$field_post = $wpdb->get_row("SELECT * FROM {$wpdb->posts} WHERE post_name = 'field_key_here'");
|
|
375
|
+
$config = maybe_unserialize($field_post->post_content);
|
|
376
|
+
$config['return_format'] = 'value';
|
|
377
|
+
$config['multiple'] = 0;
|
|
378
|
+
$wpdb->update($wpdb->posts, ['post_content' => serialize($config)], ['ID' => $field_post->ID]);
|
|
379
|
+
wp_cache_flush();
|
|
380
|
+
```text
|
|
381
|
+
|
|
382
|
+
### Duplicate Field Keys
|
|
383
|
+
|
|
384
|
+
**Symptom**: Erratic behavior, wrong fields being updated.
|
|
385
|
+
|
|
386
|
+
**Diagnosis**:
|
|
387
|
+
|
|
388
|
+
```php
|
|
389
|
+
global $wpdb;
|
|
390
|
+
$duplicates = $wpdb->get_results("
|
|
391
|
+
SELECT post_name, COUNT(*) as count
|
|
392
|
+
FROM {$wpdb->posts}
|
|
393
|
+
WHERE post_type = 'acf-field'
|
|
394
|
+
GROUP BY post_name
|
|
395
|
+
HAVING count > 1
|
|
396
|
+
");
|
|
397
|
+
print_r($duplicates);
|
|
398
|
+
```text
|
|
399
|
+
|
|
400
|
+
**Fix**: Delete duplicate fields, keeping only the correct one.
|
|
401
|
+
|
|
402
|
+
### Field Name is Empty
|
|
403
|
+
|
|
404
|
+
**Symptom**: Values saved to wrong meta keys like `fieldgroup_` instead of `fieldgroup_subfield`.
|
|
405
|
+
|
|
406
|
+
**Diagnosis**:
|
|
407
|
+
|
|
408
|
+
```php
|
|
409
|
+
global $wpdb;
|
|
410
|
+
$empty_names = $wpdb->get_results("
|
|
411
|
+
SELECT ID, post_name, post_excerpt
|
|
412
|
+
FROM {$wpdb->posts}
|
|
413
|
+
WHERE post_type = 'acf-field' AND (post_excerpt = '' OR post_excerpt IS NULL)
|
|
414
|
+
");
|
|
415
|
+
print_r($empty_names);
|
|
416
|
+
```text
|
|
417
|
+
|
|
418
|
+
**Fix**: Update the `post_excerpt` (field name) and `post_content` config:
|
|
419
|
+
|
|
420
|
+
```php
|
|
421
|
+
$wpdb->update($wpdb->posts, ['post_excerpt' => 'correct_name'], ['ID' => $field_id]);
|
|
422
|
+
$config = maybe_unserialize($field_post->post_content);
|
|
423
|
+
$config['name'] = 'correct_name';
|
|
424
|
+
$wpdb->update($wpdb->posts, ['post_content' => serialize($config)], ['ID' => $field_id]);
|
|
425
|
+
```text
|
|
426
|
+
|
|
427
|
+
## WP-CLI Commands
|
|
428
|
+
|
|
429
|
+
### List Field Groups
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
wp post list --post_type=acf-field-group --fields=ID,post_title,post_name
|
|
433
|
+
```text
|
|
434
|
+
|
|
435
|
+
### List Fields in a Group
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
wp eval '
|
|
439
|
+
global $wpdb;
|
|
440
|
+
$fields = $wpdb->get_results("SELECT ID, post_name, post_excerpt, menu_order FROM {$wpdb->posts} WHERE post_type = \"acf-field\" AND post_parent = 24 ORDER BY menu_order");
|
|
441
|
+
foreach ($fields as $f) {
|
|
442
|
+
echo $f->ID . " | " . $f->post_name . " | " . $f->post_excerpt . "\n";
|
|
443
|
+
}
|
|
444
|
+
'
|
|
445
|
+
```text
|
|
446
|
+
|
|
447
|
+
### Check Field Configuration
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
wp eval '
|
|
451
|
+
$field = acf_get_field("field_key_here");
|
|
452
|
+
print_r($field);
|
|
453
|
+
'
|
|
454
|
+
```text
|
|
455
|
+
|
|
456
|
+
### Check Post Meta Values
|
|
457
|
+
|
|
458
|
+
```bash
|
|
459
|
+
wp post meta list {post_id} | grep field_name
|
|
460
|
+
```text
|
|
461
|
+
|
|
462
|
+
### Set Field Value with Key Reference
|
|
463
|
+
|
|
464
|
+
```bash
|
|
465
|
+
wp eval '
|
|
466
|
+
$post_id = 123;
|
|
467
|
+
update_field("field_name", "value", $post_id);
|
|
468
|
+
update_post_meta($post_id, "_field_name", "field_key_here");
|
|
469
|
+
echo "Done";
|
|
470
|
+
'
|
|
471
|
+
```text
|
|
472
|
+
|
|
473
|
+
## Import Script Best Practices
|
|
474
|
+
|
|
475
|
+
When importing data programmatically:
|
|
476
|
+
|
|
477
|
+
```php
|
|
478
|
+
// 1. Always set both value and key reference
|
|
479
|
+
function set_acf_field($post_id, $field_name, $value, $field_key) {
|
|
480
|
+
update_field($field_name, $value, $post_id);
|
|
481
|
+
update_post_meta($post_id, '_' . $field_name, $field_key);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// 2. For select fields, use the choice KEY
|
|
485
|
+
set_acf_field($post_id, 'import_source', 'outscraper', 'field_import_source');
|
|
486
|
+
|
|
487
|
+
// 3. For checkboxes, use array of choice KEYS
|
|
488
|
+
set_acf_field($post_id, 'social_media_links', ['Google My Business', 'Google Maps'], 'field_abc123');
|
|
489
|
+
|
|
490
|
+
// 4. For group sub-fields, use full prefixed name
|
|
491
|
+
set_acf_field($post_id, 'group_name_sub_field', 'value', 'field_sub_field_key');
|
|
492
|
+
```text
|
|
493
|
+
|
|
494
|
+
## Field Key Discovery
|
|
495
|
+
|
|
496
|
+
To find the correct field key for a field:
|
|
497
|
+
|
|
498
|
+
```bash
|
|
499
|
+
# Method 1: From database
|
|
500
|
+
wp eval '
|
|
501
|
+
global $wpdb;
|
|
502
|
+
$field = $wpdb->get_row("SELECT post_name FROM {$wpdb->posts} WHERE post_type = \"acf-field\" AND post_excerpt = \"field_name_here\"");
|
|
503
|
+
echo $field->post_name;
|
|
504
|
+
'
|
|
505
|
+
|
|
506
|
+
# Method 2: From ACF API
|
|
507
|
+
wp eval '
|
|
508
|
+
$groups = acf_get_field_groups();
|
|
509
|
+
foreach ($groups as $group) {
|
|
510
|
+
$fields = acf_get_fields($group["key"]);
|
|
511
|
+
foreach ($fields as $field) {
|
|
512
|
+
if ($field["name"] === "field_name_here") {
|
|
513
|
+
echo $field["key"];
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
'
|
|
518
|
+
```text
|
|
519
|
+
|
|
520
|
+
## Related Documentation
|
|
521
|
+
|
|
522
|
+
| Topic | File |
|
|
523
|
+
|-------|------|
|
|
524
|
+
| WordPress development | `wp-dev.md` |
|
|
525
|
+
| WordPress admin tasks | `wp-admin.md` |
|
|
526
|
+
| LocalWP database access | `localwp.md` |
|
|
527
|
+
| Preferred plugins | `wp-preferred.md` |
|