Skip to content

A couple of field types address, widget field, link as plugins #1171

@scottsawyer

Description

@scottsawyer

3rd Party Resources

I needed these for a project this weekend. There may not be perfect, but I got the site shipped today, so...

Address field

Basically just the same as the one in the snippet library, just as a separate plugin. I am sure someone has already done this, but I couldn't find one.

https://github.com/scottsawyer/cmb2-field-address

Link Field

The link field is cool because it includes some additional fields for various link attributes. Probably add more attributes over time.

https://github.com/scottsawyer/cmb2-field-link

Widget Selector

Ok, this one is weird. I needed a way to reference preconfigured widget instances on content entry forms, similar to how Drupal's Block Reference field works. This is not obvious to me in WordPress, but I find it can be very useful.

What I wound up doing is creating a sidebar when it's installed. You can then drop in Widgets, configure them, then reference them in the metabox.

https://github.com/scottsawyer/cmb2-field-widget-selector

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions