There is no license information available for the latest version (v1.0.0-alpha-2) of this package.

v1.0.0-alpha-2 2021-11-11 15:15 UTC

This package is auto-updated.

Last update: 2024-04-16 15:50:24 UTC


README

Creating custom fields programmatically with the help of Wordplate/Extended ACF makes it easy to maintain and extend a clean setup for your Wordpress custom fields.

The aim of this repository is to create a pool of custom field types to spare you coding time. Feel free to extend this library.

Installation

  1. Run composer require schrittweiter/acf in your theme folder
  2. Make sure you are autoloading your composer vendors e.g.
require_once __DIR__.'/vendor/autoload.php';

Usage

Now you can make use of the fields like this (Please refer to the docs of wordplate in order to understand how to setup)

<?php
  use WordPlate\Acf\Location;
  use WordPlate\Acf\Image;
  use WordPlate\Acf\Text;
  use Schrittweiter\Acf\Fields\Button; // Our new Field type

  add_action('acf/init', function() {
    register_extended_field_group([
      'title' => 'About',
      'fields' => [
        Image::make('Image'),
        Text::make('Title'),
        Button::make('My Button', 'button') // gets registered here
      ],
      'location' => [
        Location::if('post_type', 'page')
      ],
    ]);
  });

and thats it! Happy creating

Supported third-party plugins

Advanced Custom Fields: Extended Pro

We have currently implemented some custom fields from ACF Extended Pro. All custom fields listed here are based on version 0.8.8.6 of the plugin.

Advanced Link

Display a modern Link Selector in a modal which allow customization. Posts, Post Types Archives & terms selection can be filtered in the field administration.

For more details visit: (https://www.acf-extended.com/features/fields/advanced-link)

Usage example:

<?php

use Schrittweiter\Acf\Fields\AdvancedLink;

AdvancedLink::make('LINK LABEL','link_fieldname')
    ->postType(['post']) // array, Filter which Post Types are allowed
    ->taxonomy(['category']) // array, Filter which Taxonomies are allowed

ACF: FocusPoint

Adds a new field type to ACF allowing users to select a focal point on image.

The plugin developer is looking for sponsors, if you like this plugin, buy him a beer by clicking the Sponsor button at his repo https://github.com/ooksanen/acf-focuspoint

Usage example:

<?php

use Schrittweiter\Acf\Fields\FocusPoint;

FocusPoint::make('FOCUS POINT LABEL','focuspoint_fieldname')
    ->instructions('Select Image.')
    ->required()
    ->mimeTypes(['jpg', 'jpeg', 'png'])
    ->previewSize('medium') // thumbnail, medium or large
    ->library('all') // all or uploadedTo

ACF OpenStreetMap Field

Adds a new field type to ACF for a hazzle free OpenStreetMap.

Usage example:

<?php

use Schrittweiter\Acf\Fields\OpenStreetMap;

OpenStreetMap::make('OPEN STREET MAP LABEL','openstreetmap_fieldname')
    ->required()

Todos

  • Complete ACF-Extended integration
  • Complete OpenStreetMap - documentation
  • Add to wpackagist instead of packagist, since this is a WP only extension