Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function em_country_flag( $replace, $EM_Event, $result ) {
- if ( $result == '#_COUNTRYFLAG' ) {
- $country_code = $EM_Event->location->country;
- if ( $country_code ) {
- $country_code = strtolower( $country_code );
- $replace = '<img src="' . get_stylesheet_directory_uri() . '/assets/img/flags/' . $country_code . '.png" alt="" class="flag" />';
- } else {
- $replace = false;
- }
- }
- return $replace;
- }
- add_filter( 'em_event_output_placeholder', 'em_country_flag', 1, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement