<?php
function modified_post_gallery( $blank = NULL, $attr )
{
echo '<pre>';
print_r( $attr );
echo '</pre>';
}
add_filter( 'post_gallery', 'modified_post_gallery', 10, 2);
?>
In media.php it shows the filter like this:
// Allow plugins/themes to override the default gallery template.
$output = apply_filters('post_gallery', '', $attr);
Its passing two variables not one and $attr is on the second variable.
Related Posts:
- current_shortcode() – detect currently used shortcode
- Check if post/page has gallery?
- how to have the gallery shortcode output one single UL list instead of several DL?
- Automatically add this attribute to the gallery shortcode
- How do i link gallery thumbnails to different url’s using the wp native gallery?
- WordPress gallery ‘post_gallery’ filter doesn’t work with feeds?
- conditional shortcode not working
- Remove width and height attributes from [gallery] output
- Gallery shortcode menu order fix no longer working on WordPress 4.0
- conditional shortcode not working
- Some doubts about gallery shortcode in WordPress
- Should I cache default WordPress gallery shortcode output?
- Numbering Image List in Gallery
- Rewriting WordPress Gallery Shortcode with Bootstrap Carousel
- change wordpress gallery shortcode to slider
- Remove hyperlink on gallery shortcode
- Add custom setting that uses radio button to WP Gallery
- WordPress Gallery shortcode: Display one category ID only
- How to get gallery id inserted to a post?
- Check if post has gallery images/media
- How to Modify WordPress Default Image Gallery Shortcode
- Change WordPress Shortcode added in to post
- Gallery shortcode – change link file image size? (not using default fullsize image)
- add action only if gallery shortcode attribute is equal to?
- Shortcode function executed twice?
- Unable to the get the gallery inserted between shortcodes
- Shortcode callback for add_action(‘wp_footer’)
- Adding shortcode field to edit gallery / Gallery Settings
- How to change the output of gallery shortcode
- How to Retrieve data of Gallery Shortcode and display it above a post
- How to copy [gallery] shortcode between posts using polylang [closed]
- Which file renders the “Edit Gallery” Settings page?
- How to display NextGEN gallery in templates?
- Use full size images in a specific gallery
- JavaScript missing from shortcode content
- How to Enable embedding WordPress default gallery in comments?
- How to add new images to existing shortcode configuration?
- Gallery shortcode is empty but magically creates a gallery
- Can we add a single caption to the gallery shortcode?
- Ajax callback and shortcode functionality
- Automatically add class-attribute to gallery?
- Replace custom gallery shortcode with default gallery shortcode
- WordPress Gallery with ID’s Shortcode not Working
- Remove width and height attributes from [gallery] output
- Changing layout of defaul gallery output to masonry
- What makes a placeholder resizable in Tinymce?
- how to show last 5 images from the one post gallery
- Gallery Shortcode: using size=”full” doesn’t call the actual thumbnail image size
- Shortcode always displaying at the top of the page
- short code output too early
- Set wmode attribute to transparent for the embed shortcode to make drop-down menu hover over YouTube embed in Internet Explorer
- How to create a shortcode to display a category description?
- Correct way to pass information between seperate shortcode functions
- If numberposts = -1 offset won’t work
- Shortcode are not working in Option tree textarea
- Font Awesome Icons Won’t Work
- detect when shortcode ran for the last time
- How can a shortcode can take the place of the featured image in a post?
- Shortcode for Twitter Bootstrap Collapse
- Is there any inherent difference between add_filter() and add_shortcode() for modifying [caption]?
- Different uniqid when calld in wp_localize_script and shortcode
- How do I debug a short code?
- How to type shortcode-like text in WordPress TinyMCE visual editor?
- Does registering multiple shortcodes impact performance?
- Shortcode for order number [closed]
- Function result goes outside div
- Displaying shortcode in footer
- Displaying shortcode output through Options Framework
- How to Generate html tags using shortcodes?
- Adding custom form within add_shortcode
- Use another action instead of the shortcode API to display the last time a user logged in
- Get array of shortcodes within string
- Adding a custom field to do_shortcode [closed]
- contact form 7 database short codes [closed]
- how to create a fav icon shortcode?
- Video shortcode, option are not rendered
- Color on Shortcode insert that creates a button
- shortcode doesnt work on excerpt
- Adding Author URL to Nav Menu via Shortcode
- Displaying an interactive web map on my wordpress site
- Date Shortcode in Image alt and title tags
- access shortcode atts in template part
- May an attribute have no value?
- SQL query to bulk change short code in all posts
- Display shortcode in text field with wordpress settings api
- WordPress show descriptions under images in gallery
- How to strip header tags & shortcodes from the_excerpt()
- shortcode display metainformation as linked image
- How to display a page dependent on a url parameter supplied by a form/button page?
- WordPress plugin shortcodes not outputting anything
- Featured image with link to post shortcode, image displaying above the post
- How to stop unwanted splits in excerpts when using shortcodes for sliders or players
- shortcode change variable base on user
- Inserting shortcode is blanking excerpt – any ideas?
- If do_shortcode is blank, return some message
- Previous/Next with the same category
- I’ve broken the short code for Contact Form 7!
- echo a shortcode in a shortcode code?
- Applying if (get_post_meta) to new shortcode
- wordpress how to sort posts on custom data with plug-in “Search & Filter”