Created
February 26, 2018 13:15
-
-
Save grola/3c0eb0d6b4c9f1ae33840659656800db to your computer and use it in GitHub Desktop.
Add parameter to attachment url
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
add_filter( 'wp_get_attachment_url', 'grola_wp_get_attachment_url', 10, 2 ); | |
function grola_wp_get_attachment_url( $url, $post_id ) { | |
return add_query_arg( 'p2', $post_id, add_query_arg( 'p', $post_id+1, $url ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment