Created
May 28, 2019 08:48
-
-
Save nuriye/aa991d12225d739a81e6aeb43325a439 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
add_filter( 'vc_gitem_template_attribute_event_button', 'vc_gitem_template_attribute_event_button', 10, 2 ); | |
function vc_gitem_template_attribute_event_button( $value, $data ) { | |
extract( array_merge( array( | |
'post' => null, | |
'data' => '', | |
), $data ) ); | |
$event_link = get_field( "event_link", $post->ID ); | |
$event_button_text = get_field( "event_button_text", $post->ID ); | |
return "<button class='btn btn-primary btn-events'><a href='$event_link' target='_blank'>$event_button_text</a></div>"; | |
} | |
add_shortcode( 'wps_event_link', 'vc_event_button_render' ); | |
function vc_event_button_render($atts, $content, $tag) { | |
return '{{event_button}}'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment