Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created February 7, 2018 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/6b0680df84c2879ae2b1e5701fbc93df to your computer and use it in GitHub Desktop.
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
<?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