Can’t change gallery output html
-
Hi,
I was trying to use the feature of foogallery where you add a filter and change the html output. I added the code snippets plugin as advised, copied the code from this page and pasted it in a new code snippet.I know I go in my function since I put some console logs in it, I see my argument before and after modification. The problem is that my gallery on the page doesn’t take my edit.
Is there something I forgot to activate ? Do I have to be on the pro version ?
Here is the code I’m trying to run:
function remove_alt_attributes( $attr, $args, $foogallery_attachment ) { if ( array_key_exists( 'title', $attr ) ) { echo '<script>console.log("'.$attr['title'].'")</script>'; $attr['title'] = "test!"; echo '<script>console.log("'.$attr['title'].'")</script>'; } return $attr; } add_filter('foogallery_attachment_html_image_attributes', 'remove_alt_attributes', 10, 3 );
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Can’t change gallery output html’ is closed to new replies.