Giter Club home page Giter Club logo

acf-builder-cheatsheet's People

Contributors

csaborio001 avatar curtisbelt avatar e-vance avatar gardinermichael avatar huubl avatar joelveloso avatar kellymears avatar kevinblackdesk avatar khaiknievel avatar knowler avatar log1x avatar mike-sheppard avatar nlemoine avatar octoxan avatar vz01d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

acf-builder-cheatsheet's Issues

addRelationship 'elements' => '' incorrect formatting

I was unable to get anything out of 'elements' until I formatted it as an array.
This code worked:
'elements' => ['featured_image']
to see all the featured images next to the relationship selection.
Not sure if I'm a noob or if this is written incorrectly in the cheat sheet as it has no array specified, only ''.
Spent a good while trying to find the solution so if this can help anyone, here it is!

how to use addTab multiple times

hi Team,

I want to use the addTab method multiple times when building fields.
But I have a problem, when I want to add a tab after endRepeater it doesn't allow, I realized that I need to save the content of each tab in one group before adding the second tab.

Can you help me find out how to not add a group to every tab?

Thanks in advance,
Vahan

Document update:

Hi

Thank you for putting togther this repo.

I had an issue when trying to sort out the placement of a group into the side bar and didn't find anything in the docs.

I found the solution here:


use StoutLogic\AcfBuilder\FieldsBuilder;


$banner = new FieldsBuilder('banner', ['title' => 'Sponsored', 'position' => 'side']);
$banner->addTrueFalse('is_sponsored_post', [
        'label' => '',
        'instructions' => 'Check if this post or page is sponsored',
        'required' => 0,
        'conditional_logic' => [],
        'wrapper' => [
            'width' => '',
            'class' => '',
            'id' => '',
        ],
        'message' => 'This is sponsored post?',
        'default_value' => 0,
        'ui' => 0,
    ])
    ->setLocation('post_type', '==', 'page')
    ->or('post_type', '==', 'post');

acf_add_local_field_group($banner->build());

It maybe worth just adding this

$banner = new FieldsBuilder('banner', ['title' => 'Sponsored', 'position' => 'side']);

It may help others too.

thanks

Add example with conditional logic

Not sure if I am missing this somewhere, but I can't seem to figure out how to implement conditional logic for a field. I tried:

'conditional_logic' => [ 'include_call_to_action', '==', 0],

and:

[ 'include_call_to_action' => 1],

Neither is working. It would be great to have an example that uses conditional logic.

Feature request: VSCode snippets

As most of the roots sage fans do, we write a lot of acf builder fields. Wouldn't it be interesting to have some snippets to complement the cheatsheet and thus write it faster?

As an example I have:

	"ACFB textarea": {
		"prefix": "ata",
		"body": [
			"->addTextarea('$1', ['label' => '${2:$1}', 'new_lines' => 'br', 'rows' => '${3:2}'])$0",
		],
		"description": "Textarea ACF Builder"
	},

Or:

	"ACFB group": {
		"prefix": "agr",
		"body": [
			"->addGroup('$1')",
			"    $0",
			"    ->endGroup()"
		],
		"description": "Group ACF Builder"
	},

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.