acf-field-network-post-select

Adds a ACF field that allows selecting posts across the network sites.

GPL-3.0 License

Stars
15

Advanced Custom Fields: Network posts select field

Adds a ACF field that allows selecting posts across the network sites.

The field is very much silimar to native ACF Post Object one, with the exception that network posts select field will allow users to search posts across the entire network rather than just the site in which dashboard they are. On field settings it's possible to confugure a list of allowed sites in network from which the posts can be selected.

Because you don't do much with post ID or object if it's for wrong site in a network, the field returns always an array that contains site_id and post_id. Then you, as a developer, can use these ID's however you like.

Note about large networks

It's highly suggested to use site filter if your network has tens of sites.

Field works, but search gets slower as the number of sites in network increases. This is something I might try to enhance in future. If your network has over 100 sites, field will try to get posts only from the first 100 sites. To change this, use acf/fields/network_post_select/settings/max_sites filter to tell how many sites are shown in field options.

In case you like to live dangerously, there's also acf/fields/network_post_select/result filter available where you can change arguments for get_sites function used in posts search.

Changelog

Changelog can be found from releases page and separate CHANGELOG.md file. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Contributing

Code contributions, feedback, and feature suggestions are very welcome.