Skip to content

Instantly share code, notes, and snippets.

@crawford252
Created April 5, 2024 16:55
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 crawford252/394ec9b37b7035ddaf92ca12172c2557 to your computer and use it in GitHub Desktop.
Save crawford252/394ec9b37b7035ddaf92ca12172c2557 to your computer and use it in GitHub Desktop.
Divi Dynamic Gallery - Custom Overlay Click Action
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