Created
April 14, 2025 16:21
-
-
Save russo97/71885cce5530725f132fa236fcaf551b to your computer and use it in GitHub Desktop.
change relationship list view in WordPress using ACF filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter('acf/fields/relationship/result', 'my_acf_fields_relationship_result', 10, 4); | |
| function my_acf_fields_relationship_result ($text, $post, $field, $post_id) { | |
| return sprintf('%d / %s / %s', $post_id, $post -> slug, $text); | |
| } | |
| // by default only $text is rendered |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment