PHPackages                             iceicetimmy/acf-post-type-selector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. iceicetimmy/acf-post-type-selector

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

iceicetimmy/acf-post-type-selector
==================================

Post type selector for Advanced Custom Fields.

v1.0.1(8y ago)559.0k25[2 issues](https://github.com/TimPerry/acf-post-type-selector/issues)GPLv2 or laterPHP

Since Apr 11Pushed 5y ago4 watchersCompare

[ Source](https://github.com/TimPerry/acf-post-type-selector)[ Packagist](https://packagist.org/packages/iceicetimmy/acf-post-type-selector)[ Docs](https://github.com/TimPerry/acf-post-type-selector)[ RSS](/packages/iceicetimmy-acf-post-type-selector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Advanced Custom Fields: acf-post-type-selector Field
====================================================

[](#advanced-custom-fields-acf-post-type-selector-field)

- **Contributors:** [@timperry](https://github.com/timperry), [@shaunbent](https://github.com/shaunbent), @emaildano, @rafegoldberg, @thomasdebruin, @gnowland
- **Tags:** ACF, Post Type Selector
- **Requires at least:** 4.0
- **Tested up to:** 5.0.0
- **Stable tag:** trunk
- **License:** GPLv2 or later
- **License URI:**

Description
-----------

[](#description)

Provides the option to select a single or multiple post types

Compatibility
-------------

[](#compatibility)

This add-on will work with:

- version 5 and up
- version 4 and up

Installation
------------

[](#installation)

This add-on can be treated as both a WP plugin and a theme include.

### Plugin

[](#plugin)

1. Copy the 'acf-post-type-selector' folder into your plugins folder
2. Activate the plugin via the Plugins admin page

### Include

[](#include)

1. Copy the 'acf-post-type-selector' folder into your theme folder (can use sub folders). You can place the folder anywhere inside the 'wp-content' directory
2. Edit your functions.php file and add the code below (Make sure the path is correct to include the acf-post-type-selector.php file)

##### ACF Version 4

[](#acf-version-4)

```
    add_action( 'acf/register_fields', 'my_register_fields' );

    function my_register_fields() {

         include_once( 'acf-post-type-selector/post-type-selector-v4.php' );

    }

```

##### ACF Version 5

[](#acf-version-5)

```
    add_action( 'acf/include_fields', 'my_register_fields' );

    function my_register_fields() {

         include_once( 'acf-post-type-selector/post-type-selector-v5.php' );

    }

```

Usage
-----

[](#usage)

### Get Field Value

[](#get-field-value)

```
$post_type_var = 'post_type';
$post_type = get_sub_field( $post_type_var );

```

### Get Field Value and Display Label

[](#get-field-value-and-display-label)

```
