> For the complete documentation index, see [llms.txt](https://whoisandywhite.gitbook.io/porterwp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whoisandywhite.gitbook.io/porterwp/filters/porter_filter_search_placeholder.md).

# porter/filter/search\_placeholder

**Type:** Filter\
**Location:** `includes/premium/filters/traits/trait-FilterGenerator.php:117`

```php
apply_filters(
    'porter/filter/search_placeholder',
    __( 'Search', 'porterwp' ),
    $key,
    $this->postType ?? 'post',
    $this->filterSettings ?? []
);
```

## Description

Allows a theme or child theme to change the Premium Filters search input placeholder without overriding the search template.

## Parameters

| Position | Variable           | Description                                                                      |
| -------- | ------------------ | -------------------------------------------------------------------------------- |
| 1        | `$placeholder`     | The default translated placeholder text.                                         |
| 2        | `$key`             | The query-string key used by the field. Usually `ps`, or `s` on search requests. |
| 3        | `$post_type`       | The current Porter filter post type, when available.                             |
| 4        | `$filter_settings` | The current filter settings array passed into the filter template.               |

## Example

```php
add_filter( 'porter/filter/search_placeholder', function( $placeholder, $key, $post_type, $filter_settings ) {
    if ( 'resource' === $post_type ) {
        return 'Search resources';
    }

    if ( 's' === $key ) {
        return 'Search site content';
    }

    return $placeholder;
}, 10, 4 );
```
