Select one or more tags, then press “Search Plugins”

Find Plugin with any / all of the selected criteria
Search Plugin

Shakewell Two-way Relationships For ACF Wordpress Plugin - Rating, Reviews, Demo & Download

Shakewell Two-way Relationships For ACF Wordpress Plugin - Rating, Reviews, Demo & Download
No ratings yet
Free
Follow for free plugins, new theme releases and theme news

Plugin Description

Link a book to its author and the author shows the book too. Remove the link on either side and it disappears from both.

You tell the plugin which fields belong together. It then keeps both posts in step whenever Advanced Custom Fields saves one of them. It stores values exactly as ACF does, so nothing needs migrating and your REST output and templates do not change.

How it behaves:

  • Works with ACF relationship fields and post object fields, single or multiple.
  • Adds the back-link at the end of the other list, so the order of existing links is kept. Linking twice never duplicates.
  • A single-value side, or a relationship side that has reached its maximum, is left as it is. The plugin never replaces another link.
  • Ignores revisions, autosaves and non-post locations such as options pages and users.
  • Does not listen to trashing, restoring or deleting a post. Links to a trashed post stay until you change them.
  • The other post is updated whenever the editor may save the first post. There is no separate capability check on the other post.
  • It does not use ACF’s own “bidirectional” setting, so it also works with data created before that setting existed.
  • No settings screen, no database tables, no front-end output.

Requires Advanced Custom Fields, free or Pro. WordPress cannot express “free or Pro” as a plugin dependency, so the plugin checks at run time and shows an admin notice if ACF is not active.

Setup

Add the pairs with the shakewell_relationship_sync_pairs filter, for example in your theme’s functions.php or a small must-use plugin. Each pair is two field names or field keys. The pair works in both directions. A field that shares its name with the field on the other post type is paired with itself:

add_filter( 'shakewell_relationship_sync_pairs', function () {
    return array(
        // Same field name in both field groups.
        array( 'book_author_relationship', 'book_author_relationship' ),
        // Different names, matched by field key.
        array( 'field_64a1b2c3d4e5f', 'field_64a1b2c3d4e60' ),
    );
} );

Field keys are shown in the field group editor when you turn on “Field keys” in the screen options.

Repair after an import

Imports and direct database edits skip ACF, so back-links can be missing. With WP-CLI:

wp shakewell-relationship-sync repair --dry-run
wp shakewell-relationship-sync repair

The command walks every post that stores a paired field, in batches, and adds the missing back-links. It never removes anything and is safe to run again. It reports posts and links checked, back-links added, links left alone because the other side was full, and links that point at deleted posts.

External services

None. The plugin makes no outside requests and collects no data.

Screenshots

No screenshots provided


Reviews & Comments