Last active
August 29, 2015 14:06
-
-
Save n7studios/912b93d9a73fcac39872 to your computer and use it in GitHub Desktop.
Soliloquy Featured Content: Add ACF Custom Field to Caption
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('soliloquy_fc_image', 'replace_caption_with_custom_field', 1, 3); | |
function replace_caption_with_custom_field($prep, $fc, $data) { | |
// Get field by Post ID - ACF (or use get_post_meta) | |
$caption = get_field('custom_field_name', $data->ID); | |
$prep['caption'] = $caption; | |
return $prep; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment