Created
January 13, 2020 15:07
-
-
Save giucu91/cea613033c8d558bc0470096a9ce91f2 to your computer and use it in GitHub Desktop.
Add title to modula links for direct image 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
<?php | |
add_filter( 'modula_shortcode_item_data', 'maricruzmodainfantil_link_title', 99, 3 ); | |
function maricruzmodainfantil_link_title( $item_data, $item, $settings ){ | |
if ( in_array( $settings['lightbox'], array( 'direct', 'attachment-page' ) ) ) { | |
if ( isset( $item_data['link_attributes']['data-title'] ) ) { | |
$item_data['link_attributes']['title'] = $item_data['link_attributes']['data-title']; | |
} | |
} | |
return $item_data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment