-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "disable-attachment-pages" module #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be great. I just noticed a small issue which I don’t think was intentional.
composer.json
Outdated
@@ -1,5 +1,5 @@ | |||
{ | |||
"name": "soberwp/intervention", | |||
"name": "runofthemill/intervention", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ I’m assuming this wasn’t meant for the PR. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, that was so I could use it with composer - forgot subsequent commits would affect the PR =D
I'll fix now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@knowler fixed!
@runofthemill are you able to update the README.md? |
I am - but I just noticed an issue when trying to upload media, so I'm going to look into that as well! |
@runofthemill thanks! |
@darrenjacoby finally got around to looking at this. fixed the issue, but honestly I'm still a little perplexed by the Lemme know if you want to keep or drop that filter, then I'll update the readme. |
@runofthemill thanks! I think we should drop the |
I'll drop it, don't think it's necessary...can always revisit later if necessary! |
@darrenjacoby removed & README updated ✌️ |
@runofthemill thanks! I'll get this merged soon, I'm going to be doing some other updates to intervention at the same time. |
I mean I only took 6 months to get this finished.... :P |
Any chance we could get this merged? Thanks! |
Merging and will release as part of a new version soon. @runofthemill 6 months pales in comparison to my 1.5 year merge timeline it seems 😬 |
Added code from https://gschoppe.com/wordpress/disable-attachment-pages/ - I tried to match the structure to other modules, but other than making the function names camel case the code is unchanged.
There's a filter available (
gjs_attachment_slug_prefix
) which I'm not sure is worth keeping, and an unused function (makeAttachmentsPrivate()
) which I asked about and got this response:I haven't done thorough testing, but enabling this module w/ intervention does indeed disable attachment pages, rewrites the URLs, and seems to work as advertised!