Quick and Easy Post creation for ACF Relationship Fields
Bazalt By Bazalt

September 15, 2016

Quick and Easy Post creation for ACF Relationship Fields Plugin

Quick & Easy Post creation on your Advanced Custom Fields (ACF) 'Relationship' & 'Post Object' Fields

This plugin is a excellent companion of ACF (Advanced Custom Fields).

When dealing with ‘Relationship’ or ‘Post Object’ fields (which links a post to one or multiple other posts), you often stumble on having to link to a post that does not exist yet. This is a frustrating and time-consuming experience: you have to save the content you were working on, then create the new post, and finally reload your primary content to be able to link to the newly created post.

This plugin simplifies this process by allowing you to create the related posts on the fly.

PRO version

This plugin is only compatible with the free version of Advanced Custom Fields.
A PRO version, compatible with ACF PRO, can be purchased here.

Translations

This plugin is actually translated in the following languages:

  • English
  • French

Feel free to help me to enhance existing translations or to propose other languages.

Support

Please use the dedicated forum for any bug or improvement suggestion.

Credits

Thanks to Elliot Condon for his amazing plugin Advanced Custom Fields

Installation

  1. Upload the plugin files to the /wp-content/plugins/ directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress

Once activated

You can enable on-the-fly post creation on a field basis.

  1. In your ACF Field Groups, locate the field you want to enable on-the-fly post creation.
  2. Check “Yes” on the field setting “Display a link to create content on the fly?”
  3. That’s all. Now, while editing your content, you’ll see a button next to your field to create a new post (see Screenshots section)

Screenshots

  1. <p>Enable post creation on your 'Relationship' or 'Post Object' Field, in ACF settings</p>

    Enable post creation on your 'Relationship' or 'Post Object' Field, in ACF settings

  2. <p>Notice the button that allows you to create a new content (in this case, a new album)</p>

    Notice the button that allows you to create a new content (in this case, a new album)

  3. <p>The new post can be created in a dedicated popup. Fill the fields as you would have done normally, and publish the post.</p>

    The new post can be created in a dedicated popup. Fill the fields as you would have done normally, and publish the post.

  4. <p>The new post is added in your relationship field</p>

    The new post is added in your relationship field

FAQ

Is it compatible with Advanced Custom Fields PRO version?

No. A PRO version of Quick and Easy Post creation for ACF Relationship Fields plugin, compatible with ACF PRO, can be purchased here.

Can we make the lightbox wider?

Unfortunately not for the moment. This will be a possible enhancement when this bug will be fixed.

Does this add-on handle bidirectional relationships?

Bidirectional relationships are out of the scope of this add-on. However, the ACF documentation gives a great example to achieve this.

Is it possible to pre-populate a child field depending on the parent from where itโ€™s been created?

Yes it is. This add-on loads the child post form in an iframe with some additional URL params:

  1. acf_rc_from_content_type: the post type of your parent post.
  2. acf_rc_from_content_ID: the ID of your parent post.

You can use these URL params to pre-populate an ACF field on your child post. Example:

<?php add_filter('acf/load_field/name=${NAME_OF_YOUR_ACF_FIELD}', 'populate_acf_field' ); function populate_acf_field( $field ) { if( !empty( $_REQUEST['acf_rc_from_content_type'] ) && $_REQUEST['acf_rc_from_content_type'] == '${YOUR_PARENT_CONTENT_TYPE}' && !empty( $_REQUEST['acf_rc_from_content_ID'] ) ) { $field['value'] = 'whatever you want'; } return $field; } 

Changelog

2.2

Compatibility with translate.wordpress.org

2.1

  • Plugin review invitation

2.0

  • Now supporting ‘Post Object’ fields ! ๐Ÿ™‚
  • Fix CSS bugs in tooltip positioning

1.2

  • Core: Add a link to the PRO version of this plugin when detecting ACF PRO version.

1.1

  • Bug fix: plugin was not working with relationship fields on attachments (in media modal)

1.0

  • First release

Details

  • Version: 2.2
  • Active installations: 60
  • WordPress Version: 4.5
  • Tested up to: 4.6.29

Ratings


5 Stars
4 Stars
3 Stars
2 Stars
1 Stars