Closed kraftbj closed 9 years ago
I am hesitant to add a way to do this specifically in Jetpack. I feel that it will introduce more headaches that the potential good it could do.
There is a way to do this programmatically external to Jetpack that has been well documented by the WordPress.com VIP team at http://vip.wordpress.com/documentation/remove-the-slug-from-your-custom-post-type-permalinks/. I think providing this solution to the edge case developers wishing to alter the slug would be best.
Thanks Ben.
If we do look at including this in Jetpack, one existing example of this in a plugin is bbPress: When registering the post type, it dynamically pulls the slug info: https://bbpress.trac.wordpress.org/browser/tags/2.5.4/bbpress.php#L478
The info is pulled by this function: https://bbpress.trac.wordpress.org/browser/tags/2.5.4/includes/forums/template.php#L33
That in turns apply a filter against this variable, which itself could have a filter applied: https://bbpress.trac.wordpress.org/browser/tags/2.5.4/bbpress.php#L218
Excellent work @kraftbj! Thanks for the details :)
I am going to stand by not wanting to do it in Jetpack however will defer to the rest of the team for a go/no-go.
What are thoughts?
What about the scenario where this change is created in the theme functions.php file and then the theme is changed?
I am looking for a way to not have that hard-coded .../portfolio/...
in my URLs. http://vip.wordpress.com/documentation/remove-the-slug-from-your-custom-post-type-permalinks/ is a dead link by now.
Also suggested here: https://wordpress.org/support/topic/portfolio-projects-folder?replies=1&view=all
What about the scenario where this change is created in the theme functions.php file and then the theme is changed?
Perhaps suggesting explicitly against that in the filter's inline docs?
This came up in 2229159-t
Any movement on this? Is there a way to do this programmatically right now?
@steven-klein No movement yet, but this one has been hanging around too long. Too late to add it to the 3.7 release cycle, so marking it for 3.8.
After an internal discussion, we've decided that we agree with @blobaugh's initial assessment, which is that this has the potential to create many more problems than it solves.
Hey Sam. Thanks for the feedback.
In practice, there are situations where a custom URL path segment really makes sense. Imagine there is a web site providing recipes for cooking. And this website is in a language other than English. It absolutely makes sense to use the portfolio feature for storing and presenting recipes. And in this case it also absolutely makes sense to replace "portfolio" with e.g. "recipes" (or "rezepte" in e.g. German) in the URL, for two reasons:
This is especially advantageous when hot-linking such content, e.g. in an email. We all know that the expressiveness/semantics of URLs are super-important.
So, if the decision is against providing this functionality, I at least would love to understand what the technical difficulties are.
I would also implement a hack/workaround as long as there is a way that survives Jetpack updates. But, once again, while there is a link to a "workaround" here in this thread, this link is dead. It would be great if someone could point out how such a workaround should look like.
This was requested in 2459124-t as well.
This was requested in 2658138-t as well.
Also suggested here: https://wordpress.org/support/topic/change-label-in-portfolio-post-type/
Requested in 3235470-t
Another vote for this would be for internationalization. It would be nice to allow for these URLs to be localized to the site's language.
suggested here: https://wordpress.org/support/topic/portfolio-blog-archives/
Requested here: https://wordpress.org/support/topic/change-portfolio-slug-3/
Requested here: https://wordpress.org/support/topic/portfolio-projects-name/
Requested in 5873940-zen for internationalization purposes
All CPTs currently in Jetpack have the rewrite arg hardcoded (e.g.
comics
,portfolio
, etc).Suggestion: Allow site owners to change the default permalink rewrite via a filter.
Originally requested in http://wordpress.org/support/topic/changing-the-portfolio-url