---
title: "Post Object Field in WordPress"
url: https://nexterwp.com/docs/wordpress-post-object-field/
date: 2026-11-12
modified: 2026-11-12
lang: en
author: "Aditya Sharma"
description: "A post object field lets an editor pick one post, page or custom post type entry — the office handling a listing, the author profile behind an article — by..."
image: https://nexterwp.com/wp-content/uploads/2026/09/wordpress-post-object-field-1024x519.jpg
word_count: 427
---

# Post Object Field in WordPress

## Key Takeaways

- Nexter Extension 4.9.0 muestra el campo Post Object en cuatro pestañas de configuración: General, Validation, Presentation y Conditional Logic.
- Post Object permite que un editor elija un solo post, page o custom post type entry mediante búsqueda; para varios elementos y ordenación, usa Relationship field.
- Return Format con ID guarda solo el ID y exige comprobar get_post_status() antes de renderizar, porque un destino eliminado o en la papelera deja su ID almacenado.

A **post object field** lets an editor pick one post, page or custom post type entry — the office handling a listing, the author profile behind an article — by searching for it.

## What It Does

Use a post object field when the connection is to one item. When an editor needs to pick several and order them, use a Relationship field instead.

## Before You Start

- Nexter Extension is installed and active.- Content Fields is enabled under **Nexter → Content Fields**.- You have a field group, or are about to create one.

## Add a Post Object Field

- Go to **Nexter → Content Fields** and open the **Group Fields** tab.

- Open a field group, or create a new one.

- Click **Add Field**.

![A field group open with the Add Field button](https://nexterwp.com/wp-content/uploads/2026/09/nxt-fields-h-shared-add-field.webp)

- Set **Field Label** to *Assigned office*. The **Field Name** fills in automatically and is what you use in code.

- Set **Field Type** to **Post Object**.

![The Field Type dropdown listing the available field types](https://nexterwp.com/wp-content/uploads/2026/09/nxt-fields-h-shared-field-type.webp)

- Under **Filter by Post Type**, choose which post types editors may pick from.

![The Post Object field settings in the Content Fields builder](https://nexterwp.com/wp-content/uploads/2026/09/nxt-fields-h-office-settings.webp)

- Set **Return Format** — an ID is the lighter option.

- Click **Update**.

![The Post Object field as it appears on the post editing screen](https://nexterwp.com/wp-content/uploads/2026/09/nxt-fields-h-office-editor.webp)

## Field Settings

Every field is configured across four tabs. These are the settings this field type offers, read from the field group builder in Nexter Extension 4.9.0.

### General

| Setting | Options | What it does |
| ------- | ------- | ------------ |
| **Filter by Post Type** | | *No help text in the UI.* |
| **Filter by Post Status** | | *No help text in the UI.* |
| **Filter by Taxonomy** | | *No help text in the UI.* |
| **Return Format** | | *No help text in the UI.* |
| **Select Multiple** | | Let editors pick more than one value. |

### Validation

| Setting | Options | What it does |
| ------- | ------- | ------------ |
| **Required** | | *No help text in the UI.* |

### Presentation

| Setting | Options | What it does |
| ------- | ------- | ------------ |
| **Instructions** | | *No help text in the UI.* |
| **Wrapper Attributes** | | *No help text in the UI.* |

### Conditional Logic

| Setting | Options | What it does |
| ------- | ------- | ------------ |
| **Conditional Logic** | | *No help text in the UI.* |

## When to Use It

- The office or branch handling a listing.- A parent or canonical entry for a post.- A featured item chosen on a landing page.

## Display the Value

With an ID returned, fetch what you need from it:

`<?php
$id = nxt_field_value( 'office' );
if ( $id && 'publish' === get_post_status( $id ) ) {
printf(
'<a href="%s">%s</a>',
esc_url( get_permalink( $id ) ),
esc_html( get_the_title( $id ) )
);
}`

## Limitations

- The link is one-directional — picking B on post A does not show A on post B.- A deleted or trashed target leaves its ID stored. Check the status before rendering, as above.

## Troubleshooting

### The picker is empty

A filter is excluding everything — most often **Filter by Post Status** set to a status your posts do not have.

### A blank link renders

The target was trashed. Guard with `get_post_status()` before output.

## Related Docs

- [Create your first field group](https://nexterwp.com/docs/create-a-field-group-wordpress/)- [Display a field value on the front end](https://nexterwp.com/docs/display-custom-field-value-wordpress/)

## Frequently Asked Questions

**Q: When should I use a post object field instead of a relationship field in WordPress?**
A: A post object field fits one-to-one connections, where an editor needs to pick a single post, page, or custom post type entry. Nexter Extension uses it for cases like an office handling a listing or the author profile behind an article. If the editor needs several items and wants to order them, that is the point where a Relationship field is the better fit.

**Q: Why is the post object picker empty in Nexter?**
A: An empty picker usually means a filter is excluding every available item. The most common cause on this page is Filter by Post Status being set to a status your posts do not actually have. In practice, that setting can hide everything even when content exists, so the first thing to check is whether the status filter matches the posts you expect to see.

**Q: What should I return from a post object field if I want lighter front-end output?**
A: Returning an ID is the lighter option, and that matters because it lets you fetch only what you need when rendering the value. The page shows an example that checks the stored ID, verifies the target is published with get_post_status(), then prints a link using get_permalink() and get_the_title(). That pattern keeps output safer and avoids rendering broken links.

**Q: How do I handle a deleted or trashed post selected in a post object field?**
A: A trashed or deleted target can still leave its ID stored in the field, so the raw value alone is not enough. The safe pattern is to check get_post_status() before outputting anything. That matters because otherwise you can end up rendering a blank or broken link even though the field still contains an ID.

**Q: What are common real-world uses for a WordPress post object field?**
A: The page points to three practical uses: assigning an office or branch to a listing, linking to a parent or canonical entry for a post, and choosing a featured item for a landing page. Those are all cases where one specific piece of content needs to be referenced rather than copied. Nexter Extension supports that one-item relationship cleanly through its Post Object field.

**Q: What settings matter most when configuring a post object field in Nexter?**
A: The most important settings are Filter by Post Type and Return Format. Filter by Post Type controls which content editors can pick from, while Return Format decides whether you store an ID or another format. The field also offers Select Multiple under General, Required under Validation, Instructions and Wrapper Attributes under Presentation, and Conditional Logic for display rules.
