PHPackages                             iceagency/lumberjack-posttypes-acf-fields - 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. [Framework](/categories/framework)
4. /
5. iceagency/lumberjack-posttypes-acf-fields

ActiveProject[Framework](/categories/framework)

iceagency/lumberjack-posttypes-acf-fields
=========================================

A Service Provider for the Lumberjack framework that allows you to define fields for your custom post types.

1.0.3(7y ago)3331MITPHP

Since Jul 10Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ICEAgency/lumberjack-posttypes-acf-fields)[ Packagist](https://packagist.org/packages/iceagency/lumberjack-posttypes-acf-fields)[ Docs](https://github.com/ICEAgency/lumberjack-posttypes-acf-fields)[ RSS](/packages/iceagency-lumberjack-posttypes-acf-fields/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Post Type Fields for Lumberjack
===============================

[](#post-type-fields-for-lumberjack)

[![Latest Stable Version](https://camo.githubusercontent.com/aaa32097d9b10c227083bb73d4b80581157402f61b144f0128f9c4f82910e524/68747470733a2f2f706f7365722e707567782e6f72672f6963656167656e63792f6c756d6265726a61636b2d706f737474797065732d6163662d6669656c64732f762f737461626c65)](https://packagist.org/packages/iceagency/lumberjack-posttypes-acf-fields)[![Coverage Status](https://camo.githubusercontent.com/d84762a7692a0e8e369ff5c9a64d00587b757d98436bfd53bdc011d061e18bbe/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4943454167656e63792f6c756d6265726a61636b2d706f737474797065732d6163662d6669656c64732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/ICEAgency/lumberjack-posttypes-acf-fields?branch=master)[![Total Downloads](https://camo.githubusercontent.com/52e65942f5f6b843fe76b65e70e09d6bb312c8317a2803c718390ad7d1c39995/68747470733a2f2f706f7365722e707567782e6f72672f6963656167656e63792f6c756d6265726a61636b2d706f737474797065732d6163662d6669656c64732f646f776e6c6f616473)](https://packagist.org/packages/iceagency/lumberjack-posttypes-acf-fields)[![License](https://camo.githubusercontent.com/5e492c3b8a4eef048d089bd65a6c1c1677935562cd153c1881c15a9d4917c9b4/68747470733a2f2f706f7365722e707567782e6f72672f6963656167656e63792f6c756d6265726a61636b2d706f737474797065732d6163662d6669656c64732f6c6963656e7365)](https://packagist.org/packages/iceagency/lumberjack-posttypes-acf-fields)

A Service Provider for the [Lumberjack](https://github.com/Rareloop/lumberjack) framework that allows you to define fields for your custom post types.

Written &amp; maintained by the team at [The ICE Agency](https://www.theiceagency.co.uk)

Please note, this repo is not ready for production.

Roadmap
-------

[](#roadmap)

1. Add support for repeater fields
2. Add support for all field types that ACF offers
3. Update documentation

Requirements
------------

[](#requirements)

- PHP &gt;=7.0
- Installation via Composer
- [Lumberjack](https://github.com/Rareloop/lumberjack)
- [Advanced Custom Fields Pro](https://wordpress.org/plugins/advanced-custom-fields/)

Installing
----------

[](#installing)

1. Install Lumberjack, see the guide [here](https://github.com/Rareloop/lumberjack).
2. Install via Composer: `composer require iceagency/lumberjack-posttypes-acf-fields`
3. Add the provider within `web/app/themes/lumberjack/config/app.php`

    ```
    'providers' => [
        ...
        IceAgency\Lumberjack\Providers\PostTypeFieldsServiceProvider::class,
        ...
    ]

    ```

Getting Started
---------------

[](#getting-started)

1. Register your Post Type within `web/app/themes/lumberjack/app/config/posttypes.php`

    ```
    'register' => [
        ...
        App\PostTypes\YourPostType::class,
        ...
    ]

    ```
2. Create your Post Type class within `web/app/themes/lumberjack/app/PostTypes/YourPostType.php`
3. Add the `HasACFFields` interface to your Post Type

    ```
    use IceAgency\Lumberjack\Interfaces\HasAcfFields;

    class YourPostType extends Post implements HasAcfFields
    {
        ...
    }

    ```
4. For each field type you need to use, ensure that you include the relevent classes at the top of your Post Type class, for this example:

    ```
    use IceAgency\Lumberjack\AcfFields\TextField;
    use IceAgency\Lumberjack\AcfFields\TextAreaField;

    ```
5. Add a static method to define your field configuration, as follows:

    ```
    public static function getFieldConfig() : array
    {
        return [
            TextField::create('text_field_name')
                ->withLabel('Text Field Label')
                ->isRequired(),
            TextAreaField::create('textarea_field_name')
                ->withLabel('Textarea Field Label')
        ]
    }

    ```

Field Types
-----------

[](#field-types)

- Text: `IceAgency\Lumberjack\AcfFields\TextField`
- Text Area: `IceAgency\Lumberjack\AcfFields\TextField`
- Image: `IceAgency\Lumberjack\AcfFields\ImageField`
- True/False: `IceAgency\Lumberjack\AcfFields\BoolField`
- Checkbox: `IceAgency\Lumberjack\AcfFields\CheckboxField`
- Email: `IceAgency\Lumberjack\AcfFields\EmailField`
- File: `IceAgency\Lumberjack\AcfFields\FileField`
- Number: `IceAgency\Lumberjack\AcfFields\NumberField`
- Page Link: `IceAgency\Lumberjack\AcfFields\PageLinkField`
- Password: `IceAgency\Lumberjack\AcfFields\PasswordField`
- Post Object: `IceAgency\Lumberjack\AcfFields\PostObjectField`
- Radio: `IceAgency\Lumberjack\AcfFields\RadioField`
- Select: `IceAgency\Lumberjack\AcfFields\SelectField`
- URL: `IceAgency\Lumberjack\AcfFields\UrlField`
- User: `IceAgency\Lumberjack\AcfFields\UserField`
- WYSIWYG: `IceAgency\Lumberjack\AcfFields\WysiwygField`

Generic Field Methods
---------------------

[](#generic-field-methods)

**create($name)**

Create a field with the name given, this is the name that is used to retrieve the data with ACF's get\_field() function

**withLabel($label)**

Set the label for the field within the WordPress Admin area.

**isRequired()**

Make the field required.

**withInstructions($instructions)**

Add instructions for the field.

**withDefaultValue($default\_value)**

Add a default value to the field.

**withPlaceholder($placeholder)**

Used to set the placeholder for the field within the WordPress Admin area. (Please note, this is only possible on Text, TextArea, Number, Email, URL and Password)

Individual Field Methods
------------------------

[](#individual-field-methods)

### Text

[](#text)

**withMaxLength($max\_length)**

Set maximum length of text (accepts integer).

**isReadOnly()**

Set field as read-only.

**isDisabled()**

Set field as disabled.

### TextArea

[](#textarea)

**withMaxLength($max\_length)**

Set maximum length of text (accepts integer).

**isReadOnly()**

Set field as read-only.

**isDisabled()**

Set field as disabled.

### Image

[](#image)

**withMinWidth($min\_width)**

Set minimum width in pixels (accepts integer)

**withMinHeight($min\_height)**

Set minimum height in pixels (accepts integer)

**withMaxWidth($max\_width)**

Set maximum width in pixels (accepts integer)

**withMaxHeight($max\_height)**

Set maximum height in pixels (accepts integer)

**withMinSize($min\_size)**

Set minimum size in MB (accepts integer)

**withMaxSize($max\_size)**

Set maximum size in MB (accepts integer)

**withMimeTypes($mime\_types)**

Comma-seperated list of mime types (e.g. "image/png,image/jpg,image/gif")

**withReturnFormat($return\_format)**

Set the format that is returned, choose from "array", "url" or "id"

### True/False

[](#truefalse)

**withMessage($message)**

Set the message that appears with the checkbox

### Checkbox

[](#checkbox)

**withOptions($options)**

Set the checkbox items that appear, $options should be an array where the key is the checkbox value and the value represents the label of the checkbox.

### File

[](#file)

**withMinSize($min\_size)**

Set minimum size in MB (accepts integer)

**withMaxSize($max\_size)**

Set maximum size in MB (accepts integer)

**withMimeTypes($mime\_types)**

Comma-seperated list of mime types (e.g. "image/png,image/jpg,image/gif")

**withReturnFormat($return\_format)**

Set the format that is returned, choose from "array", "url" or "id"

### Number

[](#number)

**withMin($min)**

Set minimum number (accepts integer).

**withMax($max)**

Set maximum number (accepts integer).

**withStep($step)**

Set how many numbers are skipped when arrows are clicked (accepts integer).

### Page Link

[](#page-link)

**withPostTypes($post\_types)**

An array of post types that should be given as options.

**withTaxonomy($taxonomy)**

An array of taxonomies that contain the options that are given.

**allowNull()**

Set if the select can be set as null.

**isMultiple()**

Allow the user to select multiple options.

### Post Object

[](#post-object)

**withPostTypes($post\_types)**

An array of post types that should be given as options.

**withTaxonomy($taxonomy)**

An array of taxonomies that contain the options that are given.

**allowNull()**

Set if the select can be set as null.

**isMultiple()**

Allow the user to select multiple options.

**withReturnFormat($return\_format)**

Choose the format that should be returned, choose between "object" and "id"

### Radio

[](#radio)

**withOptions($options)**

Set the checkbox items that appear, $options should be an array where the key is the checkbox value and the value represents the label of the checkbox.

### Select

[](#select)

**withOptions($options)**

Set the checkbox items that appear, $options should be an array where the key is the checkbox value and the value represents the label of the checkbox.

**allowNull()**

Set if the select can be set as null.

**isMultiple()**

Allow the user to select multiple options.

### User

[](#user)

**withRoles($roles)**

Set the roles of users that should appear in the select. Needs to be an array of user roles.

**allowNull()**

Set if the select can be set as null.

**isMultiple()**

Allow the user to select multiple options.

### WYSIWYG

[](#wysiwyg)

**withTabs($tab\_perference)**

Set which tabs should show on the WYSIWYG, choose between "all", "visual" and "text"

**withToolbar($toolbar\_perference)**

Set which toolbar to show in the WYSIWYG, choose between "full" and "basic"

**canUploadMedia()**

Set it so that the user can upload media with the WYSIWYG

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity66

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

4

Last Release

2890d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/41051138?v=4)[The ICE Agency](/maintainers/theiceagency)[@theiceagency](https://github.com/theiceagency)

### Embed Badge

![Health badge](/badges/iceagency-lumberjack-posttypes-acf-fields/health.svg)

```
[![Health](https://phpackages.com/badges/iceagency-lumberjack-posttypes-acf-fields/health.svg)](https://phpackages.com/packages/iceagency-lumberjack-posttypes-acf-fields)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M836](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
