Skip to content

Instantly share code, notes, and snippets.

@yozzi
Created September 9, 2015 19:26
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 yozzi/9ff483434983ccafe21e to your computer and use it in GitHub Desktop.
Save yozzi/9ff483434983ccafe21e to your computer and use it in GitHub Desktop.
Ajouter une class css a wp_get_attachment_link() pour empêcher qu'une transition animsition apparaisse à l'ouvertue de magnific popup
//Ajouter une class css a wp_get_attachment_link() pour empêcher qu'une transition animsition apparaisse à l'ouvertue de magnific popup
function startup_reloaded_modify_attachment_link( $markup, $id, $size, $permalink ) {
if (of_get_option( 'page-transition' )){
global $post;
if ( ! $permalink ) {
$markup = str_replace( '<a href', '<a class="no-animsition" href', $markup );
}
return $markup;
}
}
add_filter( 'wp_get_attachment_link', 'startup_reloaded_modify_attachment_link', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment