Forked from hwkdev/wp-acf-bypass-field-reference-db-call-get-field.php
Created
August 8, 2022 14:33
-
-
Save onwp/88ffbbf1f8ed7b7aa725be963860a479 to your computer and use it in GitHub Desktop.
This file contains 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/pre_load_reference', 'hwk_bypass_get_field_ref', 10, 3); | |
function hwk_bypass_get_field_ref($return, $field_name, $post_id){ | |
if(is_int($post_id)) | |
$return = acf_get_field($field_name, $post_id); | |
return $return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment