Coder Social home page Coder Social logo

jofrysutanto / windsor Goto Github PK

View Code? Open in Web Editor NEW
53.0 5.0 3.0 1.03 MB

YAML-ised fields configuration for ACF

Home Page: https://windsor-docs.netlify.app/

License: Apache License 2.0

PHP 77.86% JavaScript 5.40% HTML 2.34% Vue 14.32% CSS 0.08%
acf acf-windsor wordpress vscode composer

windsor's People

Contributors

dependabot[bot] avatar jofrysutanto 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

Watchers

 avatar  avatar  avatar  avatar  avatar

windsor's Issues

Call to undefined function add_action when using a dependency based WordPress structure (e.g. Bedrock)

Hi @jofrysutanto,

First of all, thanks for creating this awesome project, I can't wait to (hopefully) switch from ACF Builder as this looks like a much easier and cleaner way of using ACF with version control support ๐Ÿ˜ƒ

Unfortunately it appears that ACF Windsors can't currently work with dependency based WordPress structures such as Roots Bedrock, as add_action is called before the function exists.

Other projects such as Timber get around this by having the user initialise it via functions.php.

Hopefully this is something you'd be willing to change as I'd love to use ACF Windsor moving forward.

Any questions or what not just let me know.

Cheers,
Tom ๐Ÿ™‚

Exclude Subfields in Blueprint

I am trying to make a form builder using tabs and I use groups so that I can use the table format and condense the options. I often find ACF fails for lack of good UI. Of course I know how I could make this work, but this package is less about how to do things and more about how to do things as efficiently and DRY. That said I don't think it's possible to exclude sub_fields or it needs more explanation. Here is my example.

fields:
  tab_base: 
      label: Base 
      type: tab 
  primary: 
    label: '' 
    type: group 
    layout: table
    sub_fields:
      required: 
        label: Required 
        type: true_false 
      label: 
        label: Label 
        type: text
        required: true
      name: 
        label: Name 
        type: text 
      placeholder: 
        label: Placeholder 
        type: text 
  options: 
    label: Options 
    type: repeater
    required: true 
    layout: table
    min: 1
    button_label: 'Add Option'
    rows_per_page: 20
    sub_fields:
      option: 
        label: Option 
        type: text   
  tab_validation: 
    label: Validation 
    type: tab 
  validation: 
    label: '' 
    type: group 
    layout: table
    sub_fields:
      min: 
        label: Min 
        type: number 
      max: 
        label: Max 
        type: number 
      regex: 
        label: Regex 
        type: text 
      mask: 
        label: Mask 
        type: text 
title: 'Form'
key: 'form_default'
position: 'acf_after_title'
hide_on_screen: 
  - the_content
location:
  -
    -
      param: post_type
      operator: '=='
      value: form   
show_in_graphql: 1 
graphql_field_name: metaForm
fields:
  form_url:
    type: url
    label: Form Endpoint 
  fields: 
    label: Fields
    aria-label: ''
    type: flexible_content 
    button_label: 'Add Field'
    layouts:
      text:
        display: 'block'
        label: Text  
        sub_fields:
          form:
            label: Form  
            type: "blueprint"
            source: "form"
            prefix: false
            prefix_label: false
            excludes: 
              - options
      select:
        display: 'block'
        label: Dropdown  
        sub_fields:
          form:
            label: Form  
            type: "blueprint"
            source: "form"
            prefix: false
            prefix_label: false 
      textarea:
        display: 'block'
        label: Message  
        sub_fields:
          form:
            label: Form  
            type: "blueprint"
            source: "form"
            prefix: false
            prefix_label: false 
            excludes: 
              - options
              - validation_regex
              - regex
              - mask

Requires PHP >=8.1

Love the package. Blueprints are a lifesaver. However there are symfony dependencies that require php 8.1 or greater and that isn't an option for many Wordpress hosts at the moment. They only consider 8.0 stable. Anyway to clean this package up to be compatible. I don't really want to maintain a fork. Thanks for this awesome package.

Ever think about yaml for post type and taxonomy creation? Ive seen older implementations but something clean like your current package

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.