---
title: fluentform/post_selection_posts_pre_data
description: "## Description  This filter returns the initial field data for the post-type selection field. ```php apply_filters('fluentform/post_selection_posts_pre_data', [], $data, $form); ``` ## Usage   ```php add_filter('fluentform/post_selection_posts_pre_data', function ($posts, $data, $form) { // do your stuff return $posts; }, 10, 3); ``` ##…"
url: "https://fluentforms.com/docs/fluentform_post_selection_posts_pre_data/"
updated: "2023-07-25"
category: Filter Hooks
---

# fluentform/post_selection_posts_pre_data

## Description 

This filter returns the initial field data for the post-type selection field.

```php
apply_filters('fluentform/post_selection_posts_pre_data', [], $data, $form);
```

## Usage  

```php
add_filter('fluentform/post_selection_posts_pre_data', function ($posts, $data, $form) {
    // do your stuff
    return $posts;
}, 10, 3);
```

## Parameters

- **$posts** (array) Posts
- **$data** (array) Input Data
- **$form** (object) Form Object

## Placement

This code should be placed in the [functions.php](http://codex.wordpress.org/Theme_Development#Functions_File) file of your active theme.

## Source Code

This filter is located in *FluentFormPro\Components\Post*\PopulatePostForm -> renderPostSelectionField($data, $form)
