Created
April 5, 2024 16:55
-
-
Save crawford252/394ec9b37b7035ddaf92ca12172c2557 to your computer and use it in GitHub Desktop.
Divi Dynamic Gallery - Custom Overlay Click Action
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
function dpddg_image_overlay_action( $default_action, $props, $post_id ) { | |
$click_action = get_post_meta($post_id, 'ddg_click_action', true); | |
if(!empty($click_action)) { | |
switch($click_action) { | |
case 'none': | |
return 'none'; | |
case 'custom_link': | |
return 'link'; | |
case 'lightbox': | |
return 'lightbox'; | |
case 'gallery': | |
return 'gallery'; | |
case 'media_url': | |
return 'url'; | |
} | |
} else { | |
return $default_action; | |
} | |
} | |
add_filter( 'dpddg_image_overlay_action', 'dpddg_image_overlay_action', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment