acf-relational-fields

acf-relational-fields is a skill for Codex from Lonsdale201/wp-agent-skills. It costs 101 tokens per session (1,689 once invoked), scanned A, original, MIT.

A guide to Advanced Custom Fields (ACF) relationship fields in WordPress, which link posts, users, or taxonomy terms. It explains how WordPress stores the links and whether code receives IDs or full objects.

In plain words
What is it for?
Use it when creating or reviewing Relationship, Post Object, User, or Taxonomy fields, querying related content, or rendering linked records.
Why use it?
It prevents confusing stored IDs with returned objects and helps avoid broken reverse links, taxonomy side effects, authorization mistakes, and unsafe frontend output.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it when creating or reviewing Relationship, Post Object, User, or Taxonomy fields, querying related content, or rendering linked records.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lonsdale201/wp-agent-skills/acf-relational-fields
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Lonsdale201/wp-agent-skills --skill acf-relational-fields
Clone the repo
git clone --depth 1 https://github.com/Lonsdale201/wp-agent-skills

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for acf-relational-fields

README.md
[![agentmods](https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/acf-relational-fields/github.svg)](https://agentmods.dev/skills/lonsdale201/wp-agent-skills/acf-relational-fields)
Your own site
<a href="https://agentmods.dev/skills/lonsdale201/wp-agent-skills/acf-relational-fields"><img src="https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/acf-relational-fields/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for acf-relational-fields

Your own site · 80×15
<a href="https://agentmods.dev/skills/lonsdale201/wp-agent-skills/acf-relational-fields"><img src="https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/acf-relational-fields.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,689 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00101 $0.01689
Opus 5.5 $0.00040 $0.00676
Sonnet 5.5 $0.00020 $0.00338
Haiku 4.5 $0.00010 $0.00169

Measured 28d ago against content hash e02be171bbaf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

acf-relational-fields scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 28d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

acf/acf-relational-fields/SKILL.md · 179 lines

How it starts

The opening of the file, as written. The whole thing — 179 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ACF relational fields

Relationship, Post Object, User, and Taxonomy fields are available in ACF Free and PRO 6.8.10. Their editor controls, storage, and return values solve different parts of the problem: raw metadata stores identifiers, Return Format controls what templates receive, and optional bidirectionality writes a second ACF field on the related object.

Choose the field deliberately

Field Best fit Raw value
Relationship Curated, ordered set of posts with search/filter UI serialized array of post IDs
Post Object One post or a simpler multi-post selector post ID or serialized ID array
User One or more WordPress users user ID or serialized ID array
Taxonomy One or more terms, optionally synchronized to native object terms term ID or serialized ID array

Return Format does not rewrite the raw IDs. It controls whether get_field() returns IDs or hydrated WP_Post, WP_User, or WP_Term objects. Configure and document the format rather than accepting either shape everywhere.

Render IDs with explicit object checks

ID return formats keep the boundary clear and allow code to use the canonical WordPress loaders.

$related_ids = get_field( 'acme_related_articles', get_the_ID() );
$related_ids = is_array( $related_ids ) ? array_map( 'absint', $related_ids ) : array();

foreach ( array_slice( array_filter( $related_ids ), 0, 12 ) as $related_id ) {
    $related = get_post( $related_id );
    if ( ! $related || 'publish' !== $related->post_status ) {
        continue;
    }

    printf(
        '<a href="%s">%s</a>',
        esc_url( get_permalink( $related ) ),
        esc_html( get_the_title( $related ) )
    );
}

Do not trust a saved relation as authorization. Recheck visibility, post status, capabilities, tenancy, or membership rules at the point of use. An editor who could select an object earlier does not guarantee the current visitor may read it now.

Write relations with field keys

Read the full file on GitHub · 179 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 28d ago First seen · 179 lines · 101 tokens per session scan A e02be171bbaf

Subscribe to this mod's changes

acf-relational-fields is a skill published in the GitHub repository Lonsdale201/wp-agent-skills (24 stars, last pushed 4d ago), licensed MIT. It adds 101 tokens to every session and 1,689 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-27.

Related

Other skills, from other repositories

wp-plugin-performance

Performance guidelines for WordPress plugin development: database optimization, object caching, conditional asset loading, efficient hooks, HTTP requests, WP-Cron, AJAX/REST optimization, and common anti-patterns. Based on official WordPress Developer Resources and WP VIP documentation.

fernandotellado/ai-skills · 55 tokens

bigquery-udfs

Creates, deploys, and troubleshoots BigQuery User-Defined Functions (UDFs) and Remote Functions across SQL, JavaScript, Python, and Cloud Run endpoints. Use when writing custom scalar or aggregate functions in BigQuery, installing PyPI packages or Cloud Storage libraries in a Python or JavaScript UDF, or calling…

google/skills · 132 tokens

supabase

Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies…

supabase/agent-skills · 185 tokens

k2

Build and troubleshoot Cloudflare K2 or K2 Streams durable logs. Use for stream setup, producing from Workers or HTTP, configuring retention and inputs, and consuming through subscriptions.

cloudflare/skills · 38 tokens

kotlin-backend-jpa-entity-mapping

Model Kotlin persistence code correctly for Spring Data JPA and Hibernate. Covers entity design, identity and equality, uniqueness constraints, relationships, fetch plans, and common ORM (Object-Relational Mapping) traps specific to Kotlin. Use when creating or reviewing JPA (Java Persistence API) entities, diagnosing…

Kotlin/kotlin-agent-skills · 104 tokens

yida-data-management

A tool for querying, adding, and updating Yida form records, child tables, process records, and task-center data. It keeps ordinary forms and approval workflows on their separate data interfaces.

openyida/openyida · 89 tokens