Last active
December 15, 2015 14:09
-
-
Save bhwebworks/5272226 to your computer and use it in GitHub Desktop.
Filter Soliloquy Featured Content Slider post data to include URL entered as Slide custom post type Slide Link
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
/** | |
* Filter Soliloquy Featured Content Slider post data to include URL entered as Slide custom post type Slide Link | |
* @since 1.0 | |
* | |
*/ | |
add_filter( 'tgmsp_fc_image_data', 'bhww_soliloquy_add_custom_link', 10, 4 ); | |
function bhww_soliloquy_add_custom_link( $data, $post, $id ) { | |
$slide_link = get_post_meta( $post->ID, '_bhww_slide_link', true ); | |
$slide_link = esc_url( $slide_link ); | |
if ( !empty( $slide_link ) ) | |
$data['link'] = $slide_link; | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment