PHP code example of schrittweiter / acf

1. Go to this page and download the library: Download schrittweiter/acf library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

schrittweiter / acf example snippets





  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')
      ],
    ]);
  });



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



use Schrittweiter\Acf\Fields\FocusPoint;

FocusPoint::make('FOCUS POINT LABEL','focuspoint_fieldname')
    ->instructions('Select Image.')
    ->



use Schrittweiter\Acf\Fields\OpenStreetMap;

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