Created
February 7, 2018 21:05
-
-
Save tripflex/6b0680df84c2879ae2b1e5701fbc93df to your computer and use it in GitHub Desktop.
Output image with link from URL field for WP Job Manager Field Editor output
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 | |
// This assumes the meta key is "facebook_group" ... you must change this below if a different meta key | |
// format for the filter is field_editor_output_as_value_METAKEY | |
// You MUST set the output as to Value Only (NO HTML) | |
add_filter( 'field_editor_output_as_value_facebook_group', 'smyles_facebook_group_output_image' ); | |
function smyles_facebook_group_output_image( $value ){ | |
if( empty( $value ) ) { | |
return $value; | |
} | |
return '<a href="' . $value . '" target="_blank"><img src="https://domain.com/facebook-group-icon.jpg"></a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment